Welcome Contributors!
Thank you for your interest in contributing to FG Character Extractor. This guide will help you understand the project structure, coding standards, and contribution workflow.Project Overview
FG Character Extractor is a Go CLI tool that extracts individual character sheets from Fantasy Groundsdb.xml campaign files. The project emphasizes:
- Simplicity: Standard library only, no external dependencies
- Reliability: Comprehensive testing with golden file validation
- Cross-platform: Builds for macOS (Intel/ARM) and Windows
The project uses Go 1.25.7+ and is built with standard tooling (Go, Task, optional devbox).
Getting Started
Set up your development environment
Code Style Guidelines
FG Character Extractor follows specific conventions based onAGENTS.md. Please adhere to these standards:
Naming Conventions
Functions: snake_case
Functions: snake_case
Use Start function names with verbs for clarity.
snake_case for all function names:Variables: snake_case
Variables: snake_case
Use Short names are acceptable when context is clear (
snake_case for variables:f for file, c for character).Types: PascalCase
Types: PascalCase
Export struct types and fields:
Error Handling
Always handle errors explicitly and provide context:Use
fmt.Errorf with %w to wrap errors, preserving the error chain.XML Handling Patterns
Follow these patterns when working with XML:File I/O Patterns
Code Formatting
- No gofmt required - Code uses tabs for indentation
- 2-space indent within function bodies
- No trailing whitespace
- Single blank line between logical blocks
- Maximum line length: 80-100 characters
Testing Requirements
All contributions must include appropriate tests:Add test cases for new features
Use the golden file pattern for integration tests. See Testing for details.
Git Workflow
Follow the Conventional Commits format for all commit messages:Commit Types
feat: New feature
feat: New feature
fix: Bug fix
fix: Bug fix
docs: Documentation
docs: Documentation
refactor: Code refactoring
refactor: Code refactoring
test: Testing
test: Testing
chore: Maintenance
chore: Maintenance
Example Commits
Pull Request Process
Create a pull request
- Go to the repository on GitHub
- Click New Pull Request
- Select your branch
- Fill in the PR template:
- Description: What does this PR do?
- Motivation: Why is this change needed?
- Testing: How was this tested?
- Breaking changes: Any backward incompatibilities?
What to Contribute
Bug Fixes
Found a bug? Submit a fix with a test case that reproduces the issue
New Features
Propose new extraction features or output formats in an issue first
Documentation
Improve documentation, add examples, or clarify usage instructions
Tests
Add test cases for edge cases or untested scenarios
Code Review Guidelines
When reviewing code, we focus on:- Correctness: Does it solve the problem?
- Testing: Are there appropriate tests?
- Style: Does it follow project conventions?
- Performance: Is it efficient for large XML files?
- Maintainability: Is it clear and well-documented?
Questions and Support
How do I ask a question?
How do I ask a question?
Open a GitHub issue with the “question” label, or start a discussion.
How do I report a bug?
How do I report a bug?
Open a GitHub issue with:
- Steps to reproduce
- Expected vs actual behavior
- Sample
db.xml(if possible) - Go version and OS
How do I propose a feature?
How do I propose a feature?
Open a GitHub issue describing:
- The use case
- Proposed solution
- Alternatives considered
- Example usage
License
By contributing to FG Character Extractor, you agree that your contributions will be licensed under the MIT License. See the LICENSE file for details.Recognition
All contributors will be recognized in the project’s README. Thank you for helping make FG Character Extractor better!First time contributing to open source? Check out the First Timers Only guide.