This directory contains automation scripts for managing the jekyll-theme-zer0 gem lifecycle and feature modules.
scripts/
├── bin/ # Entry point commands (use these!)
│ ├── build # Build gem without releasing
│ ├── release # Full release workflow
│ └── test # Run all test suites
├── lib/ # Shared libraries (sourced, not executed)
│ ├── common.sh # Logging, utilities, dry-run support
│ ├── version.sh # Version management functions
│ ├── validation.sh # Environment validation
│ ├── git.sh # Git operations
│ ├── changelog.sh # Changelog generation
│ ├── gem.sh # Gem build/publish
│ └── preview_generator.py # Python preview image generator
├── features/ # Feature-specific scripts
│ ├── generate-preview-images # AI preview image generator
│ ├── install-preview-generator # Preview generator installer
│ └── validate_preview_urls.py # Preview URL validator
├── utils/ # Utility scripts
│ ├── analyze-commits # Commit analyzer for version bumps
│ ├── fix-markdown # Markdown formatting fixer
│ └── setup # Development environment setup
├── test/ # Test suites
│ ├── lib/ # Library unit tests
│ ├── theme/ # Theme validation tests
│ └── integration/ # Integration tests
└── *.sh (wrappers) # Backward-compatible wrappers
# Build gem
./scripts/bin/build
# Full release workflow
./scripts/bin/release patch # or minor/major
# Run tests
./scripts/bin/test
bin/buildBuild the gem without the full release workflow.
./scripts/bin/build [--dry-run] [--verbose]
bin/releaseFull release workflow with changelog, version bump, and publishing.
./scripts/bin/release [patch|minor|major] [options]
Options:
--dry-run Preview without making changes
--skip-tests Skip test execution
--skip-publish Skip RubyGems publishing
--no-github-release Skip GitHub release creation
--non-interactive No confirmation prompts
bin/testUnified test runner for all test suites.
./scripts/bin/test [all|lib|theme|integration] [--verbose]
generate-preview-imagesAI-powered preview image generator for Jekyll posts.
./scripts/features/generate-preview-images [options]
Options:
--list-missing List files missing previews
--dry-run Preview without changes
--collection TYPE Generate for specific collection (posts, docs, etc.)
-f, --file PATH Process specific file
--provider PROVIDER Use specific AI provider (openai)
install-preview-generatorInstall the preview image generator feature.
./scripts/features/install-preview-generator [options]
validate_preview_urls.pyValidate preview image URLs in frontmatter.
python3 scripts/features/validate_preview_urls.py [--verbose] [--suggestions]
setupSet up the development environment.
./scripts/utils/setup
analyze-commitsAnalyze commits to determine version bump type.
./scripts/utils/analyze-commits [range]
fix-markdownFix markdown formatting issues.
./scripts/utils/fix-markdown [files...]
These are sourced by other scripts, not executed directly:
common.sh - Logging utilities, colors, dry-run supportversion.sh - Version parsing, calculation, file updatesvalidation.sh - Environment and dependency validationgit.sh - Git operations (tags, commits, branches)changelog.sh - Changelog generation from commitsgem.sh - Gem build/publish operationspreview_generator.py - Python preview image generator# Run all library unit tests
./scripts/test/lib/run_tests.sh
# Run theme validation
./scripts/test/theme/validate
# Run integration tests
./scripts/test/integration/auto-version
./scripts/test/integration/mermaid
Legacy script paths (e.g., ./scripts/build.sh) are maintained as thin wrappers
that forward to the canonical locations in bin/, utils/, features/, or test/.
git clone https://github.com/bamr87/zer0-mistakes.git
cd zer0-mistakes
./scripts/utils/setup
# Make your changes
# Run tests
./scripts/bin/test
# Build (without publish)
./scripts/bin/build
# Full release
./scripts/bin/release patch
The project includes GitHub Actions workflows for automation:
.github/workflows/ci.yml).github/workflows/gem-release.yml)v*), Manual dispatch.github/workflows/version-bump.yml)Note on Bash Compatibility: All scripts are compatible with Bash 3.2+ (the default version on macOS). You do NOT need to install Homebrew Bash. The release automation, changelog generation, and all CI/CD workflows work seamlessly with the system-provided Bash on macOS and standard Bash installations on Linux.
To publish gems, you need:
RUBYGEMS_API_KEY to repository secrets# Sign in to RubyGems locally
gem signin
# Verify authentication
gem whoami
The automation system is designed for complete CI/CD integration:
./scripts/setup.sh./scripts/test.sh./scripts/version.sh./scripts/build.sh# Check status
git status
# Commit or stash changes
git add .
git commit -m "Your changes"
# Sign in to RubyGems
gem signin
# Or set up API key
echo ":rubygems_api_key: YOUR_API_KEY" > ~/.gem/credentials
chmod 600 ~/.gem/credentials
# macOS
brew install jq
# Ubuntu/Debian
sudo apt-get install jq
# Check gemspec syntax
gem specification jekyll-theme-zer0.gemspec
# Common fixes:
# - Ensure all required files exist
# - Check Ruby version compatibility
# - Validate dependency versions
--dry-run to preview changes./scripts/test.sh to catch issues earlyMost scripts support verbose output:
./scripts/test.sh --verbose
./scripts/build.sh --dry-run
If automation fails, you can manually:
# Reset version
git checkout package.json
git reset HEAD~1
# Rebuild gem
rm -f *.gem
gem build jekyll-theme-zer0.gemspec
# Force push (use with caution)
git push --force-with-lease
When contributing to the automation system:
--dry-run firstgenerate-preview-images.shAI-powered preview image generator for Jekyll posts, articles, and quests. Automatically scans content files, detects missing preview images, and generates them using AI providers (OpenAI DALL-E, Stability AI).
# List all files missing preview images
./scripts/generate-preview-images.sh --list-missing
# Dry run to see what would be generated
./scripts/generate-preview-images.sh --dry-run --verbose
# Generate images for posts collection
./scripts/generate-preview-images.sh --collection posts
# Generate image for a specific file
./scripts/generate-preview-images.sh -f pages/_posts/my-article.md
# Force regenerate all images
./scripts/generate-preview-images.sh --force
# Use different AI provider
./scripts/generate-preview-images.sh --provider stability
| Option | Description |
|---|---|
-h, --help |
Show help message |
-d, --dry-run |
Preview without making changes |
-v, --verbose |
Enable verbose output |
-f, --file FILE |
Process a specific file only |
-c, --collection NAME |
Process collection (posts, quickstart, docs, all) |
-p, --provider PROVIDER |
AI provider: openai, stability, local |
--output-dir DIR |
Output directory (default: assets/images/previews) |
--force |
Regenerate even if preview exists |
--list-missing |
Only list files with missing previews |
| Variable | Required | Description |
|---|---|---|
OPENAI_API_KEY |
For OpenAI | OpenAI API key for DALL-E |
STABILITY_API_KEY |
For Stability | Stability AI API key |
IMAGE_STYLE |
No | Custom style prompt |
IMAGE_SIZE |
No | Image dimensions (default: 1024x1024) |
IMAGE_MODEL |
No | OpenAI model (default: dall-e-3) |
The script is designed to integrate with AI agents for automated content management:
--force)A Python version is available at scripts/lib/preview_generator.py with additional features:
# Install dependencies
pip install openai pyyaml requests
# Run Python version
python3 scripts/lib/preview_generator.py --collection posts --dry-run
# 1. Check which files need preview images
./scripts/generate-preview-images.sh --list-missing
# 2. Preview what would be generated
export OPENAI_API_KEY="your-api-key"
./scripts/generate-preview-images.sh --dry-run
# 3. Generate images for specific collection
./scripts/generate-preview-images.sh --collection posts
# 4. Verify results and commit
git status
git add assets/images/previews/ pages/
git commit -m "feat: add AI-generated preview images"
For issues with the automation system: