Skip to content

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

  1. Fork and clone the repository

    Terminal window
    git clone https://github.com/YOUR-USERNAME/os-twin.git
    cd os-twin
  2. Run the install script

    Terminal window
    .agents/install.sh

    This creates the directory structure, installs Python dependencies, and validates prerequisites.

  3. Install dashboard dependencies

    Terminal window
    cd dashboard/fe
    pnpm install
  4. Verify the installation

    Terminal window
    .agents/health.sh
  5. Run the test suite to confirm everything works

    Terminal window
    pwsh -Command "Invoke-Pester .agents/tests/ -Output Detailed"

Branching Strategy

BranchPurpose
mainStable release branch
developIntegration branch
feat/descriptionNew features
fix/descriptionBug fixes
docs/descriptionDocumentation changes

Always branch from develop:

Terminal window
git checkout develop
git pull origin develop
git checkout -b feat/my-feature

PR Process

  1. Create your feature branch and make changes

  2. Run all tests before pushing

    Terminal window
    pwsh -Command "Invoke-Pester .agents/tests/ -Output Detailed"
    pytest .agents/tests/ -v
  3. Push and open a pull request against develop

    Terminal window
    git push origin feat/my-feature
  4. Fill in the PR template — include a summary, test evidence, and link to any related issues

  5. Address review feedback — maintainers will review within 48 hours

Code Style

PowerShell

  • Use PascalCase for 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 with ruff

TypeScript

  • Strict mode enabled
  • Use camelCase for variables, PascalCase for types
  • Prefer const over let
  • Format with Prettier

Testing

PowerShell tests use Pester 5+. Tests live alongside source files or in .agents/tests/:

Terminal window
pwsh -Command "Invoke-Pester .agents/tests/ -Output Detailed"

Naming convention: *.Tests.ps1

Documentation

Documentation uses Astro Starlight. To preview locally:

Terminal window
cd docs
pnpm install
pnpm dev

Write documentation in .md for reference pages and .mdx for interactive pages.