Thank you for your interest in contributing to ForgeWorks! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Pull Request Process
- Coding Standards
- Testing
- Documentation
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
- Fork the repository
- Clone your fork locally
- Set up the development environment (see below)
- Create a new branch for your changes
- Make your changes
- Submit a pull request
- Node.js 18+
- PNPM 8+
- Python 3.11+
- Docker & Docker Compose
- PostgreSQL 15+ (or use Docker)
# Clone your fork
git clone https://github.com/YOUR_USERNAME/forge-works.git
cd forge-works
# Install Node dependencies
pnpm install
# Set up Python environment
cd src/backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e ".[dev]"
cd ../..
# Start infrastructure
docker-compose up -d
# Set up database
pnpm --filter @forge-works/backend db:setup
# Verify setup
pnpm lint
pnpm testWe use trunk-based development with short-lived feature branches.
| Type | Pattern | Example |
|---|---|---|
| Feature | feature/<ticket>-<description> |
feature/FW-123-add-metrics-layer |
| Bug Fix | fix/<ticket>-<description> |
fix/FW-456-button-alignment |
| Hotfix | hotfix/<ticket>-<description> |
hotfix/FW-789-security-patch |
| Docs | docs/<description> |
docs/update-api-docs |
Rules:
- Keep branches short-lived (< 2 days ideal)
- Squash merge to main
- Delete branches after merge
Follow conventional commit format:
type(scope): description
[optional body]
[optional footer]
Types:
feat- New featurefix- Bug fixdocs- Documentationstyle- Formatting, no code changerefactor- Code restructuringtest- Adding testschore- Maintenance tasks
Examples:
feat(api): add template recommendation endpoint
fix(db): resolve connection pool exhaustion
docs(readme): update installation instructions
forge-works uses Conventional Commits + a hand-curated CHANGELOG.md.
Release-tooling rationale lives in
docs/decisions/RELEASE_TOOLING.md;
the day-to-day flow is in RELEASE.md.
Short version:
- Commit subjects are one sentence, Conventional Commits format
(e.g.
feat(api): add template recommendation endpoint). - Narrative for releases lives in
CHANGELOG.md, grouped by version with SHA references. - Tags are cut manually from
mainfor now; release-please will automate this in task #23.
You don't need to add changeset files — that tooling was removed in favor of the convention above.
-
Update your branch with the latest main:
git fetch origin git rebase origin/main
-
Run all checks before submitting:
pnpm lint pnpm test -
Create the PR with:
- Clear title following commit conventions
- Description of changes
- Link to related issues
- Screenshots for UI changes
-
Address review feedback promptly
-
Squash commits if requested
- Code follows project style guidelines
- Tests pass locally
- New code has test coverage
- Commit messages follow Conventional Commits
- Documentation updated if needed
- No console.log or debug statements
- No hardcoded secrets or credentials
- Follow PEP 8 style guide
- Use type hints for all functions
- Run
ruff checkandruff formatbefore committing - Docstrings for public functions and classes
async def get_service(
db: AsyncSession,
service_id: str,
) -> Service | None:
"""
Retrieve a service by ID.
Args:
db: Database session
service_id: UUID of the service
Returns:
Service if found, None otherwise
"""
...- Use TypeScript strict mode
- Prefer functional components with hooks
- Use named exports
- Run ESLint before committing
interface ServiceCardProps {
service: Service;
onSelect: (id: string) => void;
}
export function ServiceCard({ service, onSelect }: ServiceCardProps) {
...
}- Keep functions small and focused
- Write self-documenting code
- Add comments for complex logic
- Avoid premature optimization
# Run all backend tests
pnpm test:backend
# Run with coverage
pnpm --filter @forge-works/backend test:cov
# Run specific test file
cd src/backend
pytest tests/integration/test_api_services.py -v# Run all frontend tests
pnpm test:frontend
# Run in watch mode
cd src/frontend
pnpm test --watch- Write tests for new features
- Maintain existing test coverage
- Use descriptive test names
- Follow Arrange-Act-Assert pattern
async def test_create_service_with_valid_data():
# Arrange
service_data = {"name": "test-service", ...}
# Act
response = await client.post("/api/v1/services", json=service_data)
# Assert
assert response.status_code == 201
assert response.json()["name"] == "test-service"- Update README.md for user-facing changes
- Add/update docstrings for code changes
- Update API documentation for endpoint changes
- Keep CHANGELOG.md updated
- Use clear, concise language
- Include code examples
- Keep formatting consistent
- Test all code snippets
If you have questions about contributing, feel free to:
- Check existing issues and discussions
- Open a new issue with your question
- Reach out to maintainers
Thank you for contributing to ForgeWorks!