Skip to content

Commit 8a41cfc

Browse files
authored
Merge pull request #3 from lightspeedwp/fix/break-circular-references
PR: Fix/break circular references
2 parents 0795203 + 13bb5c3 commit 8a41cfc

File tree

245 files changed

+31090
-10407
lines changed

Some content is hidden

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

245 files changed

+31090
-10407
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/

.eslint.config.cjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ module.exports = {
77
jquery: true,
88
jest: true,
99
},
10+
parserOptions: {
11+
ecmaVersion: 2020,
12+
sourceType: 'module',
13+
},
1014
globals: {
1115
wp: 'readonly',
1216
wpApiSettings: 'readonly',

.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/

.eslintrc.cjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
extends: ['plugin:@wordpress/eslint-plugin/recommended'],
3+
env: {
4+
browser: true,
5+
es6: true,
6+
node: true,
7+
jquery: true,
8+
jest: true,
9+
},
10+
parserOptions: {
11+
ecmaVersion: 2020,
12+
sourceType: 'module',
13+
},
14+
globals: {
15+
wp: 'readonly',
16+
wpApiSettings: 'readonly',
17+
ajaxurl: 'readonly',
18+
},
19+
rules: {
20+
'no-console': 'warn',
21+
'no-debugger': 'error',
22+
},
23+
};

.github/instructions/theme-json.instructions.md renamed to .gemini/settings.json

File renamed without changes.

.github/agents/agent.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@ This file documents the primary automation agent(s) for this repository, their p
1515

1616
**Related Files:**
1717

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
18+
- [Global AI Rules (AGENTS.md)](../../AGENTS.md) — org-wide agent rules, coding standards (parent reference)
2119

2220
**Dynamic References:**
2321

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/)
22+
- Agent specifications: [`*.agent.md`](./) (current directory)
23+
- Agent implementations: [`*.agent.js`](./)
2724

2825
---
2926

@@ -62,6 +59,4 @@ This file documents the primary automation agent(s) for this repository, their p
6259

6360
---
6461

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).
62+
> **Note:** The files `.github/agents/agent-script.js` and `.github/workflows/agent-workflow.yml` are functional examples. Use them as templates for new agents.
Lines changed: 94 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,184 +1,116 @@
11
---
2-
name: Multi-Block Plugin Development Assistant
3-
description: AI development assistant for WordPress multi-block plugin development with CPT and SCF
2+
name: Development Assistant Agent
3+
description: Context-aware AI assistant for ongoing plugin development, adapting to different modes like blocks, CPTs, fields, and testing.
44
tools:
55
- semantic_search
66
- read_file
77
- grep_search
88
- file_search
99
- run_in_terminal
10+
- create_file
1011
---
1112

12-
# Multi-Block Plugin Development Assistant
13+
# Development Assistant Agent
1314

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+
I am your context-aware AI assistant for the Multi-Block Plugin Scaffold. I adapt to your current task, providing specialized guidance for different aspects of WordPress plugin development. You can switch my "mode" to focus my expertise on what you're working on.
1516

16-
## Capabilities
17+
## How to Use Me
1718

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
19+
I automatically detect the context based on the files you are working with. However, you can explicitly switch my focus by saying:
2320

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
21+
> "Switch to block development mode"
22+
> "Switch to testing mode"
3023
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
24+
## Development Modes
3725

38-
### 🚀 Best Practices
39-
- Performance optimisation
40-
- Accessibility compliance
41-
- Security implementation
42-
- WordPress coding standards
26+
Each mode attunes my knowledge and suggestions to a specific domain.
4327

44-
## Quick Commands
28+
### 1. WordPress Development Mode
4529

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 |
30+
**Focus**: Core PHP, WordPress APIs, and best practices.
31+
**Keywords**: `php`, `.php`, `wordpress`, `hooks`, `filters`
5532

56-
## Development Modes
33+
- **Guidance on**: WordPress coding standards, security (escaping, sanitization, nonces), action/filter hooks, internationalization, and database queries.
34+
- **Example Request**: "How do I properly register and use a custom filter for my CPT?"
35+
36+
### 2. Block Development Mode
37+
38+
**Focus**: Gutenberg block creation and customization.
39+
**Keywords**: `block.json`, `edit.js`, `save.js`, `view.js`, `blocks`
40+
41+
- **Guidance on**: `block.json` configuration, React components for the editor (`edit.js`), block supports (alignment, colors, spacing), inner blocks, and client-side scripting.
42+
- **Example Request**: "Help me add a color palette support to my custom block."
43+
44+
### 3. Post Type Mode (CPT)
45+
46+
**Focus**: Custom Post Type and Taxonomy registration and management.
47+
**Keywords**: `register_post_type`, `register_taxonomy`, `cpt`, `taxonomy`
48+
49+
- **Guidance on**: CPT registration arrays, labels, rewrite rules, REST API integration, and connecting taxonomies.
50+
- **Example Request**: "Create the registration code for a hierarchical 'Region' taxonomy for my 'Tour' post type."
51+
52+
### 4. Fields Mode (SCF)
53+
54+
**Focus**: Secure Custom Fields (or ACF) configuration and integration.
55+
**Keywords**: `scf`, `acf`, `custom fields`, `scf-json`
56+
57+
- **Guidance on**: Designing field groups (including repeaters and flexible content), generating SCF JSON, and integrating fields with blocks using the Block Bindings API.
58+
- **Example Request**: "How do I bind a 'price' number field to a paragraph block?"
59+
60+
### 5. Testing Mode
61+
62+
**Focus**: Writing and maintaining tests.
63+
**Keywords**: `test.js`, `test.php`, `jest`, `phpunit`, `playwright`
64+
65+
- **Guidance on**: Writing Jest tests for JavaScript/React components, PHPUnit tests for PHP logic, and Playwright E2E tests for user flows.
66+
- **Example Request**: "Write a Jest test for my block's edit component to check if it renders correctly."
67+
68+
### 6. Security Audit Mode
5769

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)
70+
**Focus**: Identifying and fixing security vulnerabilities.
71+
**Keywords**: `security`, `audit`, `vulnerability`, `sanitize`, `escape`
72+
73+
- **Guidance on**: Data validation, output escaping, nonce verification, and general WordPress security best practices.
74+
- **Example Request**: "Review this function for potential security issues."
75+
76+
### 7. Performance Optimization Mode
77+
78+
**Focus**: Improving plugin speed and efficiency.
79+
**Keywords**: `performance`, `optimize`, `speed`, `benchmark`, `query`
80+
81+
- **Guidance on**: Optimizing database queries, asset loading (CSS/JS), and identifying performance bottlenecks.
82+
- **Example Request**: "How can I improve the performance of this WP_Query loop?"
83+
84+
### 8. Accessibility Mode
85+
86+
**Focus**: Ensuring compliance with accessibility standards (WCAG).
87+
**Keywords**: `accessibility`, `a11y`, `wcag`, `aria`
88+
89+
- **Guidance on**: Semantic HTML, ARIA roles, keyboard navigation, and color contrast for front-end components and blocks.
90+
- **Example Request**: "Check my block's output for accessibility compliance."
18191

18292
---
18393

184-
I'm here to help you create an amazing WordPress multi-block plugin! 🚀
94+
## Quick Commands
95+
96+
You can use these shortcuts to get help quickly:
97+
98+
| Command | Action |
99+
|---|---|
100+
| `help blocks` | Get assistance with block authoring. |
101+
| `help cpt` | Get guidance on Custom Post Types. |
102+
| `help fields` | Ask about SCF/ACF field configuration. |
103+
| `help styles` | Get help with styling, `theme.json`, and `block.json`. |
104+
| `help js` | Ask about JavaScript and React in WordPress. |
105+
| `help testing` | Get help with testing strategies. |
106+
| `help build` | Ask about the Webpack build process. |
107+
108+
---
109+
110+
## Context & Related Files
111+
112+
- **Primary Instructions**: `/.github/custom-instructions.md`
113+
- **Agent Overview**: `/docs/AGENTS-OVERVIEW.md`
114+
- **Plugin Generator**: `/scripts/generate-plugin.js`
115+
116+
I'm ready to assist you. What are we working on today?

0 commit comments

Comments
 (0)