-
-
Notifications
You must be signed in to change notification settings - Fork 0
Fix dynamic block render callbacks and PHP function names #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 57 commits
1afb350
f737c7f
6c262e4
092b423
5dc226b
5951e75
18502c9
7ca7c1f
226cce6
6ec4c26
06169f0
dda9c1e
d939f30
8c27806
e7ade1e
b466cd7
839ca0c
f765a98
46dbbb4
fe4fbd3
15d0295
3616d95
15c90f4
507ca9d
4455eba
9e463da
1905b5b
4de6911
80c987a
bd92251
4ccfd6f
8620262
1148995
36e7e5b
ed31eab
1c9c2fb
c8a63f3
50111b4
f7e8274
ed9a7bd
2916c9d
fd207fa
8f1457d
0d70ebc
061a0cf
d40de24
c57dfc5
26e1e89
0f1dff2
008a290
2e63cbb
e5bb3ef
4f5f48f
9a01a03
cf8d542
9692aae
42e0ae7
5f845cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| # SCF-Driven Content Model | ||
|
|
||
| All post types, taxonomies, and field groups are now output as individual JSON files in `scf-json/` and registered by Secure Custom Fields (SCF). No PHP registration code is generated for post types or taxonomies. | ||
| --- | ||
| name: "Plugin Generator Agent" | ||
| description: Interactive agent that collects comprehensive requirements and generates a WordPress multi-block plugin with CPT, taxonomies, and SCF fields | ||
| tools: ["semantic_search", "read_file", "grep_search", "file_search", "run_in_terminal", "create_file", "update_file", "delete_file", "move_file"] | ||
| tools: ['vscode', 'execute', 'read', 'edit', 'search', 'web', 'github/delete_file', 'agent', 'ms-vscode.vscode-websearchforcopilot/websearch', 'todo'] | ||
| permissions: ["read", "write", "execute", "shell", "filesystem"] | ||
| --- | ||
|
Comment on lines
5
to
9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Frontmatter is missing required fields and tool-permission alignment. As per coding guidelines: "Include references to AGENTS.md and 🧰 Tools🪛 LanguageTool[uncategorized] ~7-~7: The official name of this software platform is spelled with a capital “H”. (GITHUB) 🪛 markdownlint-cli2 (0.20.0)[warning] 5-5: Heading style (MD003, heading-style) 🤖 Prompt for AI Agents |
||
|
|
||
|
|
@@ -202,9 +205,35 @@ I will ask you about each taxonomy you want to create one by one. | |
|
|
||
| ### Stage 4: Custom Fields (SCF) | ||
|
|
||
| I'll help you design field groups. I can work from a simple list or an interactive process. | ||
| I'll help you design field groups. The generator will create SCF JSON files that Secure Custom Fields automatically loads from the `scf-json/` directory. | ||
|
|
||
| For each field, please provide the **field label** (e.g., "Start Date") and the **field type** (e.g., `date_picker`). I will generate the field name automatically (e.g., `start_date`). | ||
|
|
||
| **How It Works:** | ||
| - Fields from `plugin-config.json` are converted to SCF JSON format | ||
| - Generated files are saved to `scf-json/group_{slug}_fields.json` | ||
| - SCF automatically loads and registers these field groups from JSON files | ||
| - No PHP code required - pure JSON configuration | ||
|
|
||
| **Configuration Options:** | ||
| All fields support these common properties: | ||
| - `name` — Field slug (lowercase with underscores) | ||
| - `label` — Display label in admin | ||
| - `type` — Field type (see below) | ||
| - `instructions` — Help text shown below the field | ||
| - `required` — Whether the field is required (true/false) | ||
| - `default_value` — Default value for the field | ||
| - `placeholder` — Placeholder text for text-based fields | ||
| - `choices` — Options for select/radio/checkbox fields (object with key:value pairs) | ||
| - `return_format` — Return format for certain field types (value, label, array, url, id, object) | ||
| - `multiple` — Allow multiple selections (for select/post_object/user fields) | ||
| - `allow_null` — Allow null/empty value | ||
|
|
||
| **Number Field Options:** | ||
| - `min` — Minimum value | ||
| - `max` — Maximum value | ||
| - `step` — Step increment (default: 1) | ||
|
|
||
| **Example Field Request:** | ||
| > "Add a 'Subtitle' text field, a 'Price' number field, and a 'Featured' true/false toggle." | ||
|
|
||
|
|
@@ -275,31 +304,15 @@ itinerary (repeater) | |
|
|
||
| ### Stage 6: Blocks Configuration | ||
|
|
||
| | Block | Purpose | Included | | ||
| |-------|---------|----------| | ||
| | `{{slug}}-card` | Single post card display | ✓ Default | | ||
| | `{{slug}}-collection` | Query-based post grid | ✓ Default | | ||
| | `{{slug}}-slider` | Carousel display | ✓ Default | | ||
| | `{{slug}}-single` | Full post display | ✓ Default | | ||
| | `{{slug}}-featured` | Featured posts section | ✓ Default | | ||
|
|
||
| **Block Configuration Options:** | ||
|
|
||
| For each block: | ||
| - Category (common, text, media, design, widgets) | ||
| - Icon (dashicon name) | ||
| - Supports (align, anchor, className, color, spacing) | ||
| - Variations (grid, list, slider layouts) | ||
| **Note**: Block templates have been removed from the scaffold. Blocks should be implemented as patterns or custom code. | ||
|
|
||
| ### Stage 7: Templates & Patterns | ||
|
|
||
| | Item | File | Include? | | ||
| |------|------|----------| | ||
| | Single template | `templates/single-{{slug}}.html` | ✓ Default | | ||
| | Archive template | `templates/archive-{{slug}}.html` | ✓ Default | | ||
| | Card pattern | `patterns/{{slug}}-card.php` | ✓ Default | | ||
| | Grid pattern | `patterns/{{slug}}-grid.php` | ✓ Default | | ||
| | Featured pattern | `patterns/{{slug}}-featured.php` | ✓ Default | | ||
|
|
||
| ### Stage 8: Additional Features | ||
|
|
||
|
|
@@ -460,9 +473,9 @@ Which blocks do you want? | |
|
|
||
| ### Final Configuration | ||
|
|
||
| **User**: "All defaults plus the search block" | ||
| **User**: "All defaults" | ||
|
|
||
| **Me**: "Adding search block. | ||
| **Me**: "Using all defaults. | ||
|
|
||
| **Final Configuration Summary:** | ||
|
|
||
|
|
@@ -491,21 +504,14 @@ Fields: | |
| Repeater: features (feature_name, feature_icon) | ||
|
|
||
| Blocks: | ||
| - real-estate-pro-card | ||
| - real-estate-pro-collection | ||
| - real-estate-pro-slider | ||
| - real-estate-pro-single | ||
| - real-estate-pro-featured | ||
| - real-estate-pro-search | ||
| - None (block templates removed - implement as patterns or custom code) | ||
|
|
||
| Templates: | ||
| - single-real-estate-pro.html | ||
| - archive-real-estate-pro.html | ||
|
|
||
| Patterns: | ||
| - real-estate-pro-card.php | ||
| - real-estate-pro-grid.php | ||
| - real-estate-pro-featured.php | ||
| ``` | ||
|
|
||
| **Ready to generate?** (yes/no/modify)" | ||
|
|
@@ -517,25 +523,74 @@ Patterns: | |
| After generation, I can help with: | ||
|
|
||
| ### 1. SCF Field Configuration | ||
|
|
||
| Field groups are automatically generated as JSON files: | ||
|
|
||
| ```bash | ||
| # Field groups will be in: | ||
| # Field group JSON files: | ||
| scf-json/group_{{slug}}_fields.json | ||
|
|
||
| # Schema for validation: | ||
| .github/schemas/scf-field-group.schema.json | ||
| ``` | ||
|
|
||
| **SCF Local JSON Benefits:** | ||
| - Version control friendly | ||
| - No database queries for field definitions | ||
| - Easy to backup and sync across environments | ||
| - Can be edited directly or via WordPress admin | ||
|
|
||
| The SCF_JSON class automatically configures the save/load paths so any field groups created in WordPress admin are saved to `scf-json/` and version controlled. | ||
|
|
||
| ### 2. Post Types & Taxonomies via SCF Local JSON | ||
|
|
||
| Post types and taxonomies are defined using Secure Custom Fields' Local JSON format in the `scf-json/` directory: | ||
|
|
||
| ```bash | ||
| # Post type JSON configuration: | ||
| scf-json/post-type-{{slug}}.json | ||
|
|
||
| # Taxonomy JSON configuration: | ||
| scf-json/taxonomy-{{slug}}.json | ||
| ``` | ||
|
|
||
| **SCF Post Type JSON Example:** | ||
| ```json | ||
| { | ||
| "key": "post_type_product", | ||
| "title": "Product", | ||
| "post_type": "product", | ||
| "active": true, | ||
| "labels": { | ||
| "name": "Products", | ||
| "singular_name": "Product" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### 2. Block Customisation | ||
| **SCF Local JSON Benefits:** | ||
| - Native SCF format for post types, taxonomies, and fields | ||
| - Automatic loading via SCF's Local JSON system | ||
| - Version control friendly | ||
| - No separate Content_Model_Manager needed | ||
| - Edit in WordPress admin, saved automatically to JSON | ||
|
|
||
| The SCF_JSON class configures SCF to load post types, taxonomies, and field groups from `scf-json/` directory. | ||
|
|
||
| ### 3. Block Customisation | ||
| ```bash | ||
| # Edit block attributes and supports: | ||
| src/blocks/{{slug}}-*/block.json | ||
| ``` | ||
|
|
||
| ### 3. Template Setup | ||
| ### 4. Template Setup | ||
| ```bash | ||
| # Customise templates with block bindings: | ||
| templates/single-{{slug}}.html | ||
| templates/archive-{{slug}}.html | ||
| ``` | ||
|
|
||
| ### 4. Development Start | ||
| ### 5. Development Start | ||
| ```bash | ||
| cd output-plugin | ||
| composer install | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the frontmatter to the very top of the spec.
The heading and paragraph before the frontmatter will break schema validation and the expected agent-spec template layout.
As per coding guidelines: "Start agent specification files from
.github/agents/template.agent.md; replace all placeholders and keep metadata accurate (version,last_updated,status,owners)."🧰 Tools
🪛 LanguageTool
[uncategorized] ~7-~7: The official name of this software platform is spelled with a capital “H”.
Context: ...ute', 'read', 'edit', 'search', 'web', 'github/delete_file', 'agent', 'ms-vscode.vscod...
(GITHUB)
🪛 markdownlint-cli2 (0.20.0)
[warning] 3-3: Heading style
Expected: atx; Actual: setext
(MD003, heading-style)
[warning] 5-5: Heading style
Expected: atx; Actual: setext
(MD003, heading-style)
🤖 Prompt for AI Agents