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

  1. Fork the repository on GitHub
  2. Clone your fork locally
  3. Create a feature branch from main
  4. Make your changes and commit them
  5. 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

  1. Create descriptive PR titles that summarize the change
  2. Fill out the PR template completely
  3. Link to related issues when applicable
  4. Keep PRs focused - one feature/fix per PR
  5. 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:

  1. Create a new YAML file in the appropriate subdirectory
  2. Follow naming conventions: use lowercase with hyphens
  3. Test your structure with various scenarios
  4. Add documentation explaining what the structure does
  5. 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 working
  • enhancement - New feature or request
  • documentation - Improvements to documentation
  • good first issue - Good for newcomers
  • help wanted - Extra attention is needed
  • question - 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:

  1. Check existing documentation
  2. Search existing issues
  3. Create a new issue with the question label
  4. Join our GitHub Discussions

Thank you for contributing to StructKit! ๐ŸŽ‰