Contributing to StructKit
October 28, 2025 ยท View on GitHub
Thank you for your interest in contributing to StructKit! We welcome contributions from the community and are pleased to have you join us.
๐ Quick Start
- Fork the repository on GitHub
- Clone your fork locally
- Create a feature branch from
main - Make your changes and commit them
- Push to your fork and submit a pull request
๐ Development Setup
Prerequisites
- Python 3.8 or higher
- Git
- A text editor or IDE
Local Development
Clone the repository:
git clone https://github.com/httpdss/structkit.git
cd struct
Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install in development mode:
pip install -e .
pip install -r requirements.dev.txt
Run tests to ensure everything works:
pytest
๐ง Making Changes
Code Style
- Follow PEP 8 guidelines
- Use 2 spaces for indentation in YAML files
- Use 4 spaces for indentation in Python files
- Write clear, descriptive commit messages
- Add docstrings to new functions and classes
Testing
- Write tests for new functionality
- Ensure all existing tests pass
- Run the test suite:
pytest - Check test coverage:
pytest --cov=structkit
Pull Request Guidelines
- Create descriptive PR titles that summarize the change
- Fill out the PR template completely
- Link to related issues when applicable
- Keep PRs focused - one feature/fix per PR
- Update documentation if your changes affect user-facing functionality
๐ Documentation
We use Markdown for documentation. When contributing:
- Update relevant documentation files
- Add examples for new features
- Keep language clear and concise
- Follow the existing documentation structure
Documentation Structure
docs/
โโโ index.md # Main documentation index
โโโ installation.md # Installation instructions
โโโ quickstart.md # Quick start guide
โโโ configuration.md # YAML configuration reference
โโโ template-variables.md # Template variable documentation
โโโ file-handling.md # File handling features
โโโ custom-structures.md # Creating custom structures
โโโ hooks.md # Pre/post hooks
โโโ mappings.md # External data mappings
โโโ github-integration.md # GitHub Actions integration
โโโ development.md # Development setup
โโโ completion.md # CLI completion setup
โโโ cli-reference.md # Complete CLI reference
โโโ schema.md # YAML schema reference
โโโ examples/ # Example configurations
โโโ articles.md # External articles and tutorials
โโโ known-issues.md # Known limitations
โโโ contributing.md # This file
โโโ funding.md # Funding information
๐๏ธ Contributing New Structures
StructKit includes a collection of contrib structures in structkit/contribs/. To add a new structure:
- Create a new YAML file in the appropriate subdirectory
- Follow naming conventions: use lowercase with hyphens
- Test your structure with various scenarios
- Add documentation explaining what the structure does
- Include examples in your PR description
Structure Guidelines
- Use descriptive file and folder names
- Include appropriate comments in YAML
- Follow the established patterns in existing structures
- Test with different variable combinations
- Ensure compatibility across platforms
๐ Reporting Issues
Bug Reports
When reporting bugs, please include:
- OS and Python version
- StructKit version (
structkit --version) - Complete error message or traceback
- Steps to reproduce the issue
- Expected vs actual behavior
- Sample configuration that reproduces the issue
Feature Requests
For feature requests:
- Describe the use case clearly
- Explain the benefit to other users
- Provide examples of how it would work
- Consider implementation complexity
๐ Project Structure
struct/
โโโ structkit/ # Main Python package
โ โโโ commands/ # CLI command implementations
โ โโโ contribs/ # Contributed structure templates
โ โโโ __init__.py
โ โโโ main.py # CLI entry point
โ โโโ file_item.py # File handling logic
โ โโโ template_renderer.py # Jinja2 template rendering
โ โโโ content_fetcher.py # Remote content fetching
โ โโโ model_wrapper.py # AI model integration
โ โโโ utils.py # Utility functions
โโโ tests/ # Test suite
โโโ docs/ # Documentation
โโโ examples/ # Example configurations
โโโ requirements.txt # Production dependencies
โโโ requirements.dev.txt # Development dependencies
โโโ setup.py # Package configuration
โโโ struct-schema.json # JSON schema for validation
โโโ README.md # Project overview
๐ท๏ธ Issue Labels
We use labels to categorize issues:
bug- Something isn't workingenhancement- New feature or requestdocumentation- Improvements to documentationgood first issue- Good for newcomershelp wanted- Extra attention is neededquestion- Further information is requested
๐ฌ Communication
- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - General questions and community support
- Pull Requests - Code contributions and reviews
๐ Recognition
All contributors will be recognized in our documentation and releases. We appreciate every contribution, whether it's:
- Code improvements
- Bug reports
- Documentation updates
- Feature suggestions
- Community support
๐ Code of Conduct
This project follows the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.
๐ค Getting Help
If you need help contributing:
- Check existing documentation
- Search existing issues
- Create a new issue with the
questionlabel - Join our GitHub Discussions
Thank you for contributing to StructKit! ๐