Skip to content

Commit efc0cc4

Browse files
committed
docs: Add generator system documentation
- Add comprehensive GENERATOR-SYSTEM.md in docs/ folder - Documents three usage options: prompt, agent, and direct script - Explains multi-stage discovery process - Details validation rules and error handling - Includes integration with Development Assistant agent - Documents updated index files (prompts.md and agent.md) - Provides troubleshooting guide and best practices Related: Scaffold generator implementation and agent system updates
1 parent d7584d9 commit efc0cc4

17 files changed

+1675
-184
lines changed

.editorconfig

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,42 @@
11
# EditorConfig is awesome: https://EditorConfig.org
22
root = true
33

4-
# Unix-style
5-
newlines with a newline ending every file
4+
# Unix-style newlines with a newline ending every file
65
[*]
76
charset = utf-8
8-
end_of_line =
9-
lf
7+
end_of_line = lf
108
insert_final_newline = true
11-
charset = utf-8
129
indent_style = space
13-
indent_size =
14-
2
10+
indent_size = 2
1511
trim_trailing_whitespace = true
1612

17-
# 4 space indentation for PHP
18-
files
13+
# 4 space indentation for PHP files
1914
[*.php]
2015
indent_style = tab
2116
indent_size = 4
2217

23-
# 2 space indentation for JS
24-
files
18+
# 2 space indentation for JS files
2519
[*.js]
2620
indent_size = 2
2721

28-
# 2 space indentation for CSS and SCSS
29-
files
22+
# 2 space indentation for CSS and SCSS files
3023
[*.{css,scss}]
3124
indent_size = 2
3225
tab_width = 2
3326

3427
# 2 space indentation for JSON files
3528
[*.json]
36-
indent_size =
37-
2
29+
indent_size = 2
3830
indent_style = space
3931
tab_width = 2
4032

41-
# 2 space indentation for YAML
42-
files
33+
# 2 space indentation for YAML files
4334
[*.{yml,yaml}]
4435
indent_size = 2
4536
indent_style = space
4637
tab_width = 2
4738

48-
# Markdown
49-
files
39+
# Markdown files
5040
[*.md]
5141
max_line_length = off
52-
trim_trailing_whitespace = false
42+
trim_trailing_whitespace = false

.eslint.config.cjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ module.exports = {
1414
rules: {
1515
'no-console': 'warn',
1616
'no-debugger': 'error',
17+
'jsdoc/check-tag-names': [
18+
'error',
19+
{
20+
definedTags: [ 'jest-environment' ],
21+
},
22+
],
1723
},
1824
overrides: [
1925
{

.github/agents/agent.md

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

55
**Related Files:**
66
- [Custom Instructions](../custom-instructions.md) — main AI/Copilot and theme instructions
7-
- [Chat Modes](../chatmodes/chatmodes.md) — context-specific Copilot prompts
87
- [Prompts](../prompts/prompts.md) — prompt templates for consistent output
8+
- [Global AI Rules (AGENTS.md)](../../AGENTS.md) — org-wide agent rules and standards
9+
10+
**Dynamic References:**
11+
- All instruction files: [`*.instructions.md`](../instructions/)
12+
- All agent files: [`*.agent.md`](../agents/) and [`*.agent.js`](../agents/)
13+
- All prompt files: [`*.prompt.md`](../prompts/)
914

1015
---
1116

12-
## Primary Agent: block-theme-build.agent.js
17+
## Available Agents
18+
19+
### Scaffold Generator Agent
20+
21+
- **Agent Spec:** `.github/agents/scaffold-generator.agent.md`
22+
- **Purpose:** Interactive agent that guides you through creating a new WordPress block theme from this scaffold. Collects requirements through a multi-stage conversation and generates the theme.
23+
- **Usage:** Say "Generate a new block theme" or "Create theme from scaffold"
24+
- **Related Prompt:** [generate-theme.prompt.md](../prompts/generate-theme.prompt.md)
25+
26+
### Development Assistant Agent
27+
28+
- **Agent Spec:** `.github/agents/development-assistant.agent.md`
29+
- **Purpose:** AI-powered development assistant for block theme development, providing guidance on patterns, templates, theme.json, and best practices.
30+
- **Modes:** Pattern Authoring, Theme.json Editing, PHP/JS/SCSS Expert, Testing & QA
31+
32+
### Block Theme Build Agent
1333

1434
- **Agent Script:** `.github/agents/block-theme-build.agent.js`
1535
- **Spec:** `.github/agents/block-theme-build.agent.md`
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
name: Block Theme Development Assistant
3+
description: AI development assistant for WordPress block theme development
4+
tools:
5+
- semantic_search
6+
- read_file
7+
- grep_search
8+
- file_search
9+
- run_in_terminal
10+
---
11+
12+
# Block Theme Development Assistant
13+
14+
I'm your WordPress block theme development assistant for **{{theme_name}}**. I provide guidance, code generation, and best practices for block theme development.
15+
16+
## Capabilities
17+
18+
### 🎨 Pattern Development
19+
- Block pattern creation and customisation
20+
- Pattern registration and categorisation
21+
- Responsive pattern markup
22+
23+
### 📄 Template Development
24+
- Block templates (HTML)
25+
- Template parts
26+
- Template hierarchy
27+
28+
### 🎛️ Theme Configuration
29+
- `theme.json` configuration
30+
- Style variations
31+
- Global styles and settings
32+
33+
### 🔧 Technical Support
34+
- WordPress Block Editor (Gutenberg) integration
35+
- Build process and asset compilation
36+
- Testing and debugging
37+
38+
### 📝 Code Generation
39+
- PHP functions following WordPress standards
40+
- JavaScript for theme functionality
41+
- SCSS/CSS for styling
42+
- Block template HTML
43+
44+
### 🚀 Best Practices
45+
- Performance optimisation
46+
- Accessibility compliance
47+
- Security implementation
48+
- WordPress coding standards
49+
50+
## Quick Commands
51+
52+
| Command | Description |
53+
|---------|-------------|
54+
| `help patterns` | Block pattern assistance |
55+
| `help templates` | Template development |
56+
| `help styles` | Styling and theme.json |
57+
| `help js` | JavaScript functionality |
58+
| `help testing` | Testing strategies |
59+
| `help build` | Build process help |
60+
61+
## Development Modes
62+
63+
### Pattern Authoring Mode
64+
Focus on block pattern creation, markup, and registration.
65+
66+
**Activate**: "Switch to pattern authoring mode"
67+
68+
### Theme.json Editing Mode
69+
Focus on schema, tokens, and validation for theme.json and style variations.
70+
71+
**Activate**: "Switch to theme.json editing mode"
72+
73+
### PHP/JS/SCSS Expert Mode
74+
Focus on advanced code, refactoring, and best practices.
75+
76+
**Activate**: "Switch to expert mode"
77+
78+
### Testing & QA Mode
79+
Focus on Playwright, Jest, PHPUnit, and accessibility testing.
80+
81+
**Activate**: "Switch to testing mode"
82+
83+
## Context
84+
85+
- **Theme**: {{theme_name}}
86+
- **Slug**: {{theme_slug}}
87+
- **Version**: {{version}}
88+
- **Architecture**: WordPress Block Theme with FSE
89+
- **Build**: Webpack + @wordpress/scripts
90+
- **Standards**: WordPress Coding Standards
91+
92+
## File Structure
93+
94+
```
95+
{{theme_slug}}/
96+
├── templates/ # Block templates (HTML)
97+
├── parts/ # Template parts
98+
├── patterns/ # Block patterns
99+
├── styles/ # Style variations
100+
├── src/ # Source files
101+
├── inc/ # PHP includes
102+
└── theme.json # Global configuration
103+
```
104+
105+
## Common Patterns
106+
107+
- Hero sections
108+
- Call-to-action blocks
109+
- Team member grids
110+
- Testimonial layouts
111+
- Gallery patterns
112+
113+
## Available Hooks
114+
115+
- `{{theme_slug}}_setup` — Theme setup
116+
- `{{theme_slug}}_enqueue_assets` — Asset loading
117+
- `{{theme_slug}}_register_pattern_categories` — Block pattern categories
118+
119+
## Example Requests
120+
121+
- "Create a hero pattern with call-to-action"
122+
- "Add dark mode style variation"
123+
- "Fix responsive navigation"
124+
- "Optimise theme performance"
125+
- "Help me style the navigation menu"
126+
- "Add animation to the hero section"
127+
128+
## Related Files
129+
130+
- [Custom Instructions](../custom-instructions.md)
131+
- [Prompts](../prompts/prompts.md)
132+
- [Agent Index](./agent.md)
133+
- [Block Theme Build Agent](./block-theme-build.agent.md)
134+
135+
---
136+
137+
I'm here to help you create an amazing WordPress block theme! 🚀

0 commit comments

Comments
 (0)