Contribution Guide
This guide covers the end-to-end process for contributing to OSTwin, from local setup through pull request approval.
Prerequisites
- Git 2.40+
- PowerShell 7+ (
pwsh) - Python 3.11+
- Node.js 20+
- pnpm 9+
Local Setup
-
Fork and clone the repository
Terminal window git clone https://github.com/YOUR-USERNAME/os-twin.gitcd os-twin -
Run the install script
Terminal window .agents/install.shThis creates the directory structure, installs Python dependencies, and validates prerequisites.
-
Install dashboard dependencies
Terminal window cd dashboard/fepnpm installTerminal window cd dashboardpip install -r requirements.txt -
Verify the installation
Terminal window .agents/health.sh -
Run the test suite to confirm everything works
Terminal window pwsh -Command "Invoke-Pester .agents/tests/ -Output Detailed"Terminal window pytest .agents/tests/ -vTerminal window cd cypressnpx cypress run
Branching Strategy
| Branch | Purpose |
|---|---|
main | Stable release branch |
develop | Integration branch |
feat/description | New features |
fix/description | Bug fixes |
docs/description | Documentation changes |
Always branch from develop:
git checkout developgit pull origin developgit checkout -b feat/my-featurePR Process
-
Create your feature branch and make changes
-
Run all tests before pushing
Terminal window pwsh -Command "Invoke-Pester .agents/tests/ -Output Detailed"pytest .agents/tests/ -vTerminal window pytest .agents/tests/ -x --tb=short -
Push and open a pull request against
developTerminal window git push origin feat/my-feature -
Fill in the PR template — include a summary, test evidence, and link to any related issues
-
Address review feedback — maintainers will review within 48 hours
Code Style
PowerShell
- Use
PascalCasefor function names and parameters - Use approved verbs (
Get-,Set-,Start-,Stop-) - Include comment-based help for public functions
- Maximum line length: 120 characters
Python
- Follow PEP 8
- Use type hints for all function signatures
- Docstrings in Google style
- Format with
black, lint withruff
TypeScript
- Strict mode enabled
- Use
camelCasefor variables,PascalCasefor types - Prefer
constoverlet - Format with Prettier
Testing
PowerShell tests use Pester 5+. Tests live alongside source files or in .agents/tests/:
pwsh -Command "Invoke-Pester .agents/tests/ -Output Detailed"Naming convention: *.Tests.ps1
Python tests use pytest. Tests live in .agents/tests/ and dashboard/tests/:
pytest .agents/tests/ -v --cov=.agentspytest dashboard/tests/ -vNaming convention: test_*.py
E2E tests for the dashboard use Cypress:
cd cypressnpx cypress runnpx cypress open # interactive modeTests live in cypress/e2e/.
Documentation
Documentation uses Astro Starlight. To preview locally:
cd docspnpm installpnpm devWrite documentation in .md for reference pages and .mdx for interactive pages.