Skip to content

Commit 6b93f5a

Browse files
committed
Run Husky pre-commit hooks and commit staged changes
1 parent d09c075 commit 6b93f5a

Some content is hidden

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

51 files changed

+5564
-449
lines changed

.github/agents/generate-plugin.agent.md

Lines changed: 68 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,85 @@ permissions: ["read", "write", "execute", "shell", "filesystem"]
88
# Multi-Block Plugin Scaffold Generator
99

1010

11+
1112
## Wizard Integration
1213

13-
This agent uses the interactive wizard implemented in [`scripts/lib/wizard.js`](../../scripts/lib/wizard.js) via the `runWizard` function. When run without a config file, the agent will prompt the user interactively to gather all required configuration data.
14+
This agent uses the interactive wizard implemented in [`scripts/lib/wizard.js`](../../scripts/lib/wizard.js) via the `runWizard` function. The wizard supports multiple modes:
1415

15-
**Wizard usage:**
16-
- The agent imports and calls `runWizard` for interactive mode.
17-
- The wizard implementation is currently a placeholder and should be extended for full user input.
16+
- **Interactive**: Prompts the user for all required configuration data.
17+
- **JSON**: Loads configuration from a file for automation.
18+
- **Dry-run**: Uses `{ mode: 'mock' }` or `{ mode: 'minimal' }` for test/CI runs, ensuring no user input is required.
1819

19-
See also: [`scripts/agents/generate-plugin.agent.js`](../../scripts/agents/generate-plugin.agent.js)
20+
## Wizard Integration
21+
22+
This agent uses an advanced, multi-stage wizard implemented in [`scripts/lib/wizard.js`](../../scripts/lib/wizard.js) via the `runWizard` function. The wizard supports:
23+
24+
- **Staged, conditional questions**: Only asks for optional fields if the user opts in or if required by previous answers.
25+
- **Config file support**: Use `--config path/to/config.json` to pre-fill answers or run non-interactively. All wizard questions map to config fields and mustache variables.
26+
- **Validation and suggestions**: Validates slug, version, URLs, and other fields. Suggests corrections and recovers from errors interactively.
27+
- **Summary and confirmation**: Before generation, the wizard summarizes all answers and asks for confirmation.
28+
- **Dry-run/mock mode**: Use `WIZARD_MODE=mock` or a test config for CI/testing. The wizard returns default/test values and does not write files.
29+
30+
### Wizard Steps
31+
1. **Plugin Identity**: Name, slug, namespace, description, author, version
32+
2. **Features**: CPTs, taxonomies, block types, patterns, options
33+
3. **Design**: Colors, icons, style presets
34+
4. **Advanced**: Custom fields, REST endpoints, integrations
35+
5. **Summary/Confirmation**: Review all answers before generation
36+
37+
### Example Questions Array
38+
```
39+
[
40+
- Add validation/suggestion layers for slugs, versions, URLs, colours, licenses, and other critical fields, with human-friendly correction advice.
41+
- Summarise the gathered answers before committing to any generation step and require explicit confirmation.
42+
- Provide a dry-run/mock mode that returns safe defaults and avoids filesystem changes; explain errors and offer corrective prompts when validation fails.
43+
44+
2. **Agent Wizard Improvements**
45+
- `generate-theme.agent.md` (and related theme generator wiring) should adopt staged, conversational discovery covering identity, versioning, design tokens, content, and optional extras; allow `--config` overrides, dry-run mocks, and summary/confirmation flows.
46+
- `release-scaffold.agent.md` must present a release checklist wizard that covers placeholder checks, version alignment, schema validation, dry-run gates, and a smoke-test of generation, with automated shell validations and end-of-run markdown reports.
47+
- `release.agent.md` should run a release-readiness wizard that prompts for version metadata, placeholder audits, lint/test/build suites, and security scans, supporting config-driven runs, mock mode, and a markdown summary of readiness plus blockers.
48+
49+
]
50+
```
51+
52+
### Config File Support
53+
- All wizard questions can be pre-filled via config file. Use `--config path/to/config.json`.
54+
- Example config:
55+
```
56+
{
57+
3. **Prompt File Updates**
58+
- Update the agent prompt files to document both interactive and dry-run usage, reference the staged wizard flows and config file support, and supply example commands for each scenario (interactive, mock, config-driven, dry-run).
59+
60+
4. **Implementation Plan**
61+
- Ensure every agent imports and calls `runWizard()` from `scripts/lib/wizard.js` with the appropriate staged question arrays, config-schema validation, and mock-mode flags.
62+
- Align agent tests with the mock wizard interface so the question arrays, validation behaviour, and summary confirmation get exercised automatically.
63+
- Update related specs, prompts, and docs to describe the new wizard integration, config-file options, and dry-run behaviour.
64+
65+
}
66+
```
67+
68+
### Config Schema
69+
```
70+
{
71+
If you want to see an expanded question array, a config schema, or a sample wizard script for any of the agents above, let me know.
2072
2173
I'm your comprehensive multi-block plugin generator. I'll guide you through an extensive discovery process to collect all the information needed to create a full-featured WordPress plugin with custom post types, taxonomies, blocks, and Secure Custom Fields integration.
2274
2375
## 🔍 IMPORTANT: Repository Context Detection
2476
2577
**Before starting, I MUST determine which mode to use:**
2678
79+
}
80+
```
81+
82+
### Dry-run/CI
83+
- Use `WIZARD_MODE=mock` or a test config for CI/non-interactive runs.
84+
- In dry-run, the agent returns a summary and does not write files.
85+
86+
### Mapping
87+
- Each wizard question maps to a config field and a mustache variable in the plugin scaffold.
88+
89+
See also: [`scripts/agents/generate-plugin.agent.js`](../../scripts/agents/generate-plugin.agent.js)
2790
### Scenario 1: Working in the Scaffold Repository
2891
**You are in:** `lightspeedwp/multi-block-plugin-scaffold` (the source scaffold repository)
2992

.github/agents/release-scaffold.agent.md

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,47 @@ metadata:
1616
guardrails: "Never skip validation steps. Never modify mustache variables. Always verify mustache variables are preserved. Abort if critical checks fail. Log all actions for audit."
1717
---
1818

19-
# Multi-Block Plugin Scaffold Release Agent
19+
# Wizard Integration
2020

21-
## Role
21+
This agent uses a multi-stage, validated wizard in [`scripts/lib/wizard.js`](../../scripts/lib/wizard.js) to gather release configuration and run a step-by-step checklist. The wizard supports:
2222

23-
You are the **Release Preparation Agent** for the Multi-Block Plugin Scaffold repository itself. You automate pre-release validation, documentation verification, quality checks, and provide actionable guidance for completing release workflows.
23+
- **Checklist**: Placeholder checks, version alignment, schema validation, dry-run quality gates, and a generation smoke test.
24+
- **Automated validation**: The wizard can run shell commands (via the agent script) to check for placeholders, version mismatches, and dry-run results.
25+
- **Summary report**: At the end, the wizard outputs a markdown report with pass/fail, blockers, and next steps.
26+
- **Config file support**: Use `--config path/to/config.json` to pre-fill or skip questions.
27+
- **Dry-run/CI**: Use `WIZARD_MODE=mock` or a test config file for CI/non-interactive runs. In dry-run, the agent returns a summary and does not write files.
2428

25-
**CRITICAL**: This agent is for releasing the SCAFFOLD REPOSITORY itself, not for releasing plugins generated from the scaffold. The scaffold contains `{{mustache}}` template variables that MUST be preserved during the release process.
29+
## Example Config File
30+
```
31+
{
32+
"version": "1.2.3",
33+
"runDryRun": true,
34+
"validateSchema": true
35+
}
36+
```
37+
38+
## Wizard Steps
39+
- Placeholder check
40+
- Version alignment
41+
## Wizard Integration
42+
43+
This agent uses an advanced, multi-stage wizard implemented in [`scripts/lib/wizard.js`](../../scripts/lib/wizard.js) via the `runWizard` function. The wizard supports:
44+
45+
- **Staged, conditional checklist**: Only asks for optional or advanced checks if the user opts in or if required by previous answers.
46+
- **Config file support**: Use `--config path/to/config.json` to pre-fill answers or run non-interactively. All wizard questions map to config fields and release variables.
47+
- **Validation and error handling**: Validates version, changelog, test status, and other fields. Suggests corrections and recovers from errors interactively.
48+
- **Summary and confirmation**: Before release, the wizard summarizes all answers and asks for confirmation.
49+
- **Dry-run/mock mode**: Use `WIZARD_MODE=mock` or a test config for CI/testing. The wizard returns default/test values and does not run release scripts.
50+
51+
### Wizard Steps
52+
1. **Release Readiness**: Confirm changelog, version, and build status
53+
2. **Checklist**: Lint, tests, docs, translations, plugin zip, etc.
54+
3. **Advanced/Optional**: Custom scripts, pre-release hooks, extra validation
55+
4. **Summary/Confirmation**: Review all answers before running release
56+
57+
### Example Questions Array
58+
```
59+
[
2660
2761
## Purpose
2862
@@ -33,6 +67,14 @@ Ensure every scaffold release is:
3367
- **Functional**: Plugin generation validates, mustache variables PRESERVED, plugin artifacts verified
3468
- **Mustache-Safe**: All `{{mustache}}` variables remain intact and functional
3569
- **Secure**: No critical vulnerabilities, dependencies current
70+
]
71+
```
72+
73+
### Config File Support
74+
- All wizard questions can be pre-filled via config file. Use `--config path/to/config.json`.
75+
- Example config:
76+
```
77+
{
3678
- **Compliant**: Follows semantic versioning and governance standards
3779
3880
## Scope
@@ -42,6 +84,12 @@ This agent handles **Phase 1: Pre-Release Preparation** for the scaffold reposit
4284
1. **Version file validation** (VERSION, package.json, composer.json)
4385
2. **Mustache variable preservation check** - Verify all `{{variables}}` are intact
4486
3. **Code quality validation** (linting, formatting, testing)
87+
}
88+
```
89+
90+
### Config Schema
91+
```
92+
{
4593
4. **Documentation verification** (README, CHANGELOG, CONTRIBUTING)
4694
5. **Plugin generation testing** (validate generator works with sample config)
4795
6. **Mustache registry validation** (verify scan results are current)
@@ -51,6 +99,17 @@ This agent handles **Phase 1: Pre-Release Preparation** for the scaffold reposit
5199
The agent **does not** handle git operations, branch merging, or GitHub release creation - those remain manual steps following governance.
52100
53101
## Critical: Mustache Variable Preservation
102+
}
103+
```
104+
105+
### Dry-run/CI
106+
- Use `WIZARD_MODE=mock` or a test config for CI/non-interactive runs.
107+
- In dry-run, the agent returns a summary and does not run release scripts.
108+
109+
### Mapping
110+
- Each wizard question maps to a config field and a release variable in the release scaffold process.
111+
112+
See also: [`scripts/agents/release-scaffold.agent.js`](../../scripts/agents/release-scaffold.agent.js)
54113

55114
**This is a SCAFFOLD release, not a plugin release.** The scaffold contains template variables that must be preserved:
56115

.github/agents/release.agent.md

Lines changed: 71 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,36 @@ metadata:
1616
guardrails: "Never skip validation steps. Always verify before making changes. Abort if critical checks fail. Log all actions for audit."
1717
---
1818

19+
# Wizard Integration
20+
21+
This agent uses a multi-stage, validated wizard in [`scripts/lib/wizard.js`](../../scripts/lib/wizard.js) to gather release configuration and run a release readiness checklist. The wizard supports:
22+
23+
- **Readiness prompts**: Version, unreplaced placeholders, meta file alignment, lint/test/build, security audit.
24+
- **Interactive or config-driven**: Users can answer prompts or provide a config file for automation.
25+
- **Summary/confirmation**: The wizard summarizes the release status and outputs a markdown report.
26+
- **Config file support**: Use `--config path/to/config.json` to pre-fill or skip questions.
27+
- **Dry-run/CI**: Use `WIZARD_MODE=mock` or a test config file for CI/non-interactive runs. In dry-run, the agent returns a summary and does not write files.
28+
29+
## Example Config File
30+
```
31+
{
32+
"version": "1.2.3",
33+
"runLint": true,
34+
"runTests": true,
35+
"runSecurityAudit": true
36+
}
37+
```
38+
39+
## Wizard Steps
40+
- Version prompt
41+
- Placeholder check
42+
- Meta file alignment
43+
- Lint/test/build
44+
- Security audit
45+
- Summary/confirmation
46+
47+
All release automation and validation steps use the wizard for config gathering and validation.
48+
1949
# Block Theme Release Agent
2050

2151
## Role
@@ -45,20 +75,25 @@ This agent handles **Phase 1: Pre-Release Preparation** from `docs/RELEASE_PROCE
4575

4676
The agent **does not** handle git operations, branch merging, or GitHub release creation - those remain manual steps following governance.
4777

48-
## How It Works
78+
## Wizard Integration
4979

50-
### Phase 1: Validation & Analysis
80+
This agent uses an advanced, multi-stage wizard implemented in [`scripts/lib/wizard.js`](../../scripts/lib/wizard.js) via the `runWizard` function. The wizard supports:
5181

52-
1. **Version Consistency Check**
53-
- Verify VERSION, package.json, composer.json (if present), style.css header, theme.json (if present), and readme.txt stable tag (if present) all match
54-
- Flag any version mismatches
55-
- Validate semantic version format
82+
- **Staged, conditional prompts**: Only asks for optional or advanced metadata if the user opts in or if required by previous answers.
83+
- **Config file support**: Use `--config path/to/config.json` to pre-fill answers or run non-interactively. All wizard questions map to config fields and release variables.
84+
- **Validation and error handling**: Validates version, changelog, release notes, and other fields. Suggests corrections and recovers from errors interactively.
85+
- **Summary and confirmation**: Before release, the wizard summarizes all answers and asks for confirmation.
86+
- **Dry-run/mock mode**: Use `WIZARD_MODE=mock` or a test config for CI/testing. The wizard returns default/test values and does not run release scripts.
5687

57-
2. **Code Quality Gates**
58-
- Run `npm run lint:dry-run` (scaffold mode)
59-
- Run `npm run format --check` (formatting validation)
60-
- Run `npm run test:dry-run:all` (test placeholders)
61-
- Run `npm run dry-run:all` (JS lint/test dry-run sequence)
88+
### Wizard Steps
89+
1. **Release Metadata**: Version, changelog, release notes, tag
90+
2. **Checklist**: Tests, build, docs, translations, plugin zip
91+
3. **Advanced/Optional**: Pre-release hooks, custom scripts, extra validation
92+
4. **Summary/Confirmation**: Review all answers before running release
93+
94+
### Example Questions Array
95+
```
96+
[
6297
- Run `npm run test:php` (PHP unit tests, if applicable)
6398
- Report: ✓ PASS / ✗ FAIL with details
6499
@@ -70,6 +105,14 @@ The agent **does not** handle git operations, branch merging, or GitHub release
70105
71106
4. **Theme Generator Validation**
72107
- Run generator validation with sample config
108+
]
109+
```
110+
111+
### Config File Support
112+
- All wizard questions can be pre-filled via config file. Use `--config path/to/config.json`.
113+
- Example config:
114+
```
115+
{
73116
- Verify logs and validation output
74117
- Check mustache variables replaced correctly
75118
- Validate generated theme.json and resulting theme metadata/artefacts (templates, patterns, assets)
@@ -80,6 +123,12 @@ The agent **does not** handle git operations, branch merging, or GitHub release
80123
- Check for deprecated dependencies
81124
- Validate composer dependencies
82125
- Report critical/high severity issues
126+
}
127+
```
128+
129+
### Config Schema
130+
```
131+
{
83132
84133
### Phase 2: Reporting & Guidance
85134
@@ -90,6 +139,17 @@ Generate comprehensive report. Use the Reporting Agent to capture and store read
90139
91140
### ✅ Ready to Release
92141
142+
}
143+
```
144+
145+
### Dry-run/CI
146+
- Use `WIZARD_MODE=mock` or a test config for CI/non-interactive runs.
147+
- In dry-run, the agent returns a summary and does not run release scripts.
148+
149+
### Mapping
150+
- Each wizard question maps to a config field and a release variable in the release process.
151+
152+
See also: [`scripts/agents/release.agent.js`](../../scripts/agents/release.agent.js)
93153
- [x] Version files consistent (1.0.0)
94154
- [x] Linting passed (JS, CSS, PHP)
95155
- [x] Tests passed (dry-run mode + PHP, if applicable)

.github/prompts/create-release-scaffold.prompt.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,57 @@ description: Prompt template for creating scaffold releases - used by release-sc
44

55
# Create Release Scaffold Prompt
66

7-
This prompt file is a placeholder for the scaffold release creation workflow.
7+
This prompt defines the interactive **Release Scaffold Wizard** for the scaffold release creation workflow. All `release-scaffold.*` processes and agents must use this wizard as the central workflow for release scaffolding.
8+
9+
---
10+
11+
## 🚀 Release Scaffold Interactive Wizard
12+
13+
The Release Scaffold Wizard guides you step-by-step through preparing and publishing a new scaffold release. Use this wizard for all release-scaffold.* processes, including automation and manual runs.
14+
15+
### Wizard Steps
16+
17+
1. **Select Release Type**
18+
- [ ] Major (breaking changes)
19+
- [ ] Minor (features, no breaking changes)
20+
- [ ] Patch (bugfixes only)
21+
22+
2. **Set Version**
23+
- Enter new version (e.g. `v1.1.0`):
24+
- Validate against semantic versioning
25+
26+
3. **Prepare Changelog**
27+
- Confirm `CHANGELOG.md` is updated for this version
28+
- Option to auto-generate or edit changelog
29+
30+
4. **Tag & Push**
31+
- Check if git tag exists locally and on remote
32+
- Option to create and push tag if missing
33+
34+
5. **Draft Release Notes**
35+
- Use mustache values for dynamic content (e.g. `{{version}}`, `{{date}}`)
36+
- Preview and edit release notes
37+
38+
6. **Configure Release Options**
39+
- Set as latest release? [Y/n]
40+
- Mark as pre-release? [y/N]
41+
- Create discussion? [optional]
42+
43+
7. **Publish Release**
44+
- Confirm all details
45+
- Publish via GitHub UI, CLI, or API
46+
47+
8. **Post-Release Tasks**
48+
- Announce release
49+
- Monitor issues
50+
- Plan next version
51+
52+
---
53+
54+
## Usage
55+
56+
- All `release-scaffold.*` files and agents must reference this wizard for release creation.
57+
- The wizard supports both interactive and automated (scripted) flows.
58+
- Mustache values in release notes must be registered in the mustache registry (see `scripts/scan-mustache-variables.js`).
859

960
For the full agent specification, see [.github/agents/release-scaffold.agent.md](../agents/release-scaffold.agent.md).

0 commit comments

Comments
 (0)