This document provides guidance for AI agents working on the ShopifyThemeBuilder Ruby gem.
ShopifyThemeBuilder is a Ruby gem that provides an opinionated builder for Shopify themes with the following key features:
- Component-based nested folder structure
- Tailwind CSS integration
- Stimulus framework support
- Streamlined Shopify theme development workflow
shopify_theme_builder/
├── lib/
│ ├── shopify_theme_builder.rb # Main gem entry point
│ └── shopify_theme_builder/
│ └── version.rb # Gem version definition
├── spec/ # Test files
├── bin/ # Executable scripts
├── sig/ # RBS type signatures
├── Gemfile # Dependencies
├── Rakefile # Rake tasks
├── shopify_theme_builder.gemspec # Gem specification
└── README.md # Project documentation
- Language: Ruby (>= 3.2.0 required)
- Purpose: Shopify theme development tooling
- Architecture: Component-based approach with modern frontend tools
- License: MIT
- Authors: Massimiliano Lattanzio, Nebulab Team
- Follow Ruby style conventions
- Maintain compatibility with Ruby 3.2+
- Follow semantic versioning for releases
- Follow Rubocop linting rules (run with
bin/rubocop)
- Use RSpec for testing (run with
bin/rspec) - Ensure all new features have corresponding tests
- Test files are located in the
spec/directory
- Main functionality should be in
lib/shopify_theme_builder/ - Keep the main entry point (
lib/shopify_theme_builder.rb) clean - Use proper module namespacing under
ShopifyThemeBuilder
- Minimize external dependencies
- Consider the impact on Shopify theme development workflow
- Ensure compatibility with Tailwind CSS and Stimulus
- Create corresponding spec files in
spec/ - Implement functionality in
lib/shopify_theme_builder/ - Update version in
lib/shopify_theme_builder/version.rbif needed - Run tests with
bin/rspec - Update documentation if necessary
- Run
bin/setupto install dependencies - Use
bin/consolefor interactive testing - Install locally with
bundle exec rake install
- Run
bin/release <version>(e.g.,bin/release 0.1.0) - This will create a git commit updating version in
lib/shopify_theme_builder/version.rb, create git tags and push to RubyGems
When working on this project:
-
Focus Area: This gem is specifically for Shopify theme development, so consider:
- Shopify Liquid templating
- Theme file structure requirements
- Asset compilation and optimization
- Component organization patterns
-
Target Users: Developers building Shopify themes who want:
- Better code organization
- Modern CSS framework integration (Tailwind)
- JavaScript framework integration (Stimulus)
- Streamlined build processes
-
Integration Points: Consider how this gem interacts with:
- Shopify CLI and development tools
- Tailwind CSS build processes
- Stimulus controller organization
- Component-based architecture
-
Best Practices:
- Maintain backward compatibility
- Provide clear error messages
- Support different Shopify theme structures
- Optimize for developer experience
- GitHub: https://github.com/nebulab/shopify_theme_builder
- Owner: nebulab
- Main Branch: main
- License: MIT
- Documentation: https://github.com/nebulab/shopify_theme_builder#readme
- Bug Reports: https://github.com/nebulab/shopify_theme_builder/issues
- This is currently in pre-release (version 0.1.0.pre)
- Usage instructions are still being developed
- The gem focuses on modern frontend tooling for Shopify themes
- Component-based architecture is a core principle