| description | Comprehensive automation scripts, utilities, and maintenance tools for LightSpeedWP projects. Modular design with shared infrastructure and extensive testing. | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| version | 2.5 | |||||||||||||||||||||||||||||||||||||||||||||
| last_updated | 2025-12-04 | |||||||||||||||||||||||||||||||||||||||||||||
| owners |
|
|||||||||||||||||||||||||||||||||||||||||||||
| references |
|
This directory contains all automation, utility, and maintenance scripts for the LightSpeedWP project. Scripts are grouped by function for modularity, maintainability, and testability.
graph TB
A[Scripts Directory] --> B[awesome-copilot/]
A --> C[includes/]
A --> D[json-validation/]
A --> E[maintenance/]
A --> F[projects/]
A --> G[utility/]
A --> H[validation/]
C --> I[Core Utilities]
C --> J[Test Helpers]
C --> K[CLI Support]
C --> L[File Operations]
B --> M[Collection Management]
D --> N[Schema Validation]
E --> O[Documentation Updates]
F --> P[GitHub Projects]
G --> Q[General Tools]
H --> R[Config Validation]
S[GitHub Actions] --> A
T[Pre-commit Hooks] --> A
U[CI/CD Pipeline] --> A
style A fill:#e1f5fe
style C fill:#f3e5f5
style S fill:#e8f5e8
sequenceDiagram
participant Dev as Developer
participant Scripts as Scripts System
participant Tests as Test Suite
participant CI as CI/CD Pipeline
participant Deploy as Deployment
Dev->>Scripts: Execute script
Scripts->>Scripts: Load includes/utilities
Scripts->>Scripts: Validate inputs
Scripts->>Scripts: Perform operations
Scripts->>Tests: Run validation tests
Tests->>Scripts: Return results
Scripts->>CI: Trigger workflows
CI->>Deploy: Deploy if successful
Deploy->>Dev: Notify completion
- awesome-copilot/ — Utilities for prompt/collection management and validation.
See:awesome-copilot/README.md - includes/ — Shared Bash helpers and test utilities.
See:includes/README.md - json-validation/ — Node.js/YAML validation scripts and tests.
See:json-validation/README.md - logs/ — Log output for script runs.
- maintenance/ — Scripts for repo maintenance, documentation, and label automation.
See:maintenance/README.md - projects/ — GitHub Projects management and automation scripts.
See:projects/README.md - utility/ — General-purpose shell and Node.js utilities for label management, logging, and validation.
See:utility/README.md
The includes/ directory provides reusable components used across all scripts:
- Core Utilities:
logging.sh,validation.sh,colors.sh,common-functions.sh - CLI Support:
cli-utils.shfor standardized argument parsing and help - File Operations:
file-operations.shfor safe file system interactions - Test Helpers:
enhanced-test-helpers.bash,agent-test-helpers.bash - Network Functions:
git-functions.shfor Git operations
Manages prompt collections and Copilot-related functionality:
- Collection creation, validation, and maintenance
- YAML frontmatter processing
- Cross-platform line ending normalization
- README generation for collections
Repository maintenance and automation:
- Documentation generation and updates
- GitHub label synchronization
- Badge management for workflows
- Changelog validation
- Issue type management
General-purpose tools and libraries:
- Label management and reporting
- Release validation
- Shell script linting
- Version synchronization
- Status enforcement
Configuration file validation:
- CodeRabbit configuration validation
- Schema-based YAML validation
- Automated schema updates
GitHub Projects management:
- Project creation and updates
- Field management
- Access control configuration
- Project type templates
Each script directory has a corresponding __tests__/ subdirectory:
awesome-copilot/__tests__/— Tests for Copilot utilitiesincludes/__tests__/— Tests for shared helpersjson-validation/__tests__/— Tests for validation scriptsmaintenance/__tests__/— Tests for maintenance scriptsutility/__tests__/— Tests for utility functions
Scripts integrate with GitHub Actions workflows:
- Pre-commit validation
- Automated documentation updates
- Label synchronization
- Release validation
- Test execution
Scripts work with various configuration files:
.coderabbit.yml— CodeRabbit configuration.github/schemas/— JSON/YAML validation schemas.github/workflows/— GitHub Actions definitionsfixtures/— Test data and templates
# Validate collections
scripts/awesome-copilot/validate-collections.js
# Update documentation
scripts/maintenance/update-readme-and-changelog.sh
# Synchronize labels
scripts/utility/label-sync.js --dry-run
# Validate configuration
node scripts/validation/validate-coderabbit-yml.cjs# Run all tests
./run-all-tests.sh
# Run category-specific tests
scripts/maintenance/run-maintenance-tests.sh
scripts/utility/run-utility-tests.sh
# Run individual test files
bats scripts/includes/__tests__/test-logging.bats#!/bin/bash
# Source shared utilities
source "$(dirname "$0")/../includes/core/logging.sh"
source "$(dirname "$0")/../includes/core/validation.sh"
source "$(dirname "$0")/../includes/cli/cli-utils.sh"
# Use standardized functions
parse_common_args "$@"
log_info "Starting script execution"
validate_required_command "git"Validation tooling applied to scripts:
| Area | Tool | Purpose |
|---|---|---|
| Shell | ShellCheck | Static analysis for Bash scripts |
| Bash tests | Bats | Behaviour validation of shell utilities |
| JS/TS | ESLint | Linting and code quality checks |
| Collections | Custom validator | Ensures collection schema compliance |
| Frontmatter | Schema validator | Validates metadata blocks |
| Markdown | Markdownlint | Documentation formatting consistency |
Example aggregate run (placeholder):
./run-all-tests.sh # Executes all test suites
npm run lint # Lints JS/TS sources
shellcheck scripts/**/*.sh # Shell linting
markdownlint scripts/**/*.md # README / docs lintVersion: 2.5 (increment when public script interfaces or includes contracts change).
Refer to ../CHANGELOG.md for release context and automation evolution.
Collection validation failed? Ensure collection.schema.json is up to date and YAML frontmatter paths are correct.
Scripts sourcing wrong path? Use $(dirname "$0") patterns and avoid relative assumptions.
Permission denied running script? Add executable bit: chmod +x <script>.
Bats tests not found? Verify test file naming pattern test-*.bats and correct path in run script.
- Some legacy scripts may not yet use standardized logging wrappers.
- JSON validation tooling scheduled for consolidation into a single CLI.
- Multi-platform (macOS/Linux) parity tests are partial; Windows support not prioritized.
| Dependency | Minimum | Purpose |
|---|---|---|
| Node.js | 18+ | Run JS/validation scripts |
| Bash | 5.x | Execute shell automation |
| Bats | Latest | Shell test framework |
| ShellCheck | Latest | Shell static analysis |
| jq | Latest | JSON manipulation |
- GitHub CLI — For GitHub API interactions
- Node.js — For JavaScript validation scripts
- Bats — For Bash script testing
- ShellCheck — For shell script linting
- jq — For JSON processing
- Script Development: Follow coding standards and include proper headers
- Testing: Add comprehensive tests in appropriate
__tests__/directory - Documentation: Update README files and inline documentation
- Validation: Run linting and validation tools
- Integration: Ensure compatibility with existing workflows
- Update dependencies and schemas
- Validate all configuration files
- Run comprehensive test suites
- Update documentation and badges
- Synchronize labels and issue types
- Check log files in
logs/directory - Monitor GitHub Actions workflow results
- Validate script execution in CI/CD pipelines
- Review test coverage and failures
flowchart TD
A[Script Execution] --> B{Check Dependencies}
B -->|Missing| C[Install Dependencies]
B -->|Available| D[Load Includes]
C --> D
D --> E[Parse CLI Arguments]
E --> F[Validate Inputs]
F --> G{Validation Pass?}
G -->|No| H[Show Error & Exit]
G -->|Yes| I[Execute Main Logic]
I --> J[Run Tests if Available]
J --> K{Tests Pass?}
K -->|No| L[Report Failures]
K -->|Yes| M[Log Success]
L --> N[Exit with Error]
M --> O[Exit Successfully]
style A fill:#e1f5fe
style I fill:#e8f5e8
style O fill:#c8e6c9
style N fill:#ffcdd2
When contributing new scripts or modifications:
- Follow the established directory structure
- Use shared utilities from
includes/ - Add comprehensive tests
- Update relevant README files
- Ensure all validation passes
- Document dependencies and usage
- LightSpeedWP Main Repository
- Coding Standards Instructions
- Quality Assurance
- WordPress Development Standards
⚡ Empowering WordPress development through intelligent automation and shared utilities.
Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! Contributors