Developer Guide / Contribution

Contribution Workflow & PR Standards

The PR submission process follows the standard Fork → modify → check → submit pattern. Each step is detailed below to help you complete your contribution smoothly.

From Fork to Merge: Complete Flow

%%{init: {'theme': 'default', 'themeVariables': { 'primaryColor': '#fffaf3', 'primaryTextColor': '#1d2a30', 'primaryBorderColor': '#20323a', 'lineColor': '#66757d', 'secondaryColor': '#f5efe6', 'tertiaryColor': '#ffffff', 'fontFamily': 'Inter, system-ui, sans-serif', 'textColor': '#1d2a30', 'nodeBkg': '#ffffff', 'nodeBorder': '#20323a', 'nodeTextColor': '#1d2a30', 'clusterBkg': '#f5efe6', 'clusterBorder': '#20323a', 'titleColor': '#1d2a30', 'edgeLabelBackground': '#ffffff', 'edgeLabelColor': '#66757d', 'arrowheadColor': '#66757d'}}}%% flowchart LR classDef localBox fill:#dbe8f7,stroke:#4b7eb4,stroke-width:2px,color:#2a4a6a,font-weight:500 classDef checkNode fill:#f8e5b7,stroke:#cc951e,stroke-width:2.5px,color:#7a5a0a,font-weight:500 classDef remoteBox fill:#f6d0c3,stroke:#ca6a49,stroke-width:2px,color:#7a3a28,font-weight:500 classDef successBox fill:#dff0e6,stroke:#5f9e77,stroke-width:2.5px,color:#2d5a3f,font-weight:600 classDef step fill:#ffffff,stroke:#66757d,stroke-width:1.5px,color:#1d2a30 subgraph LOCAL["💻 Your Local"] direction LR A([Fork repo]):::step --> B([Create branch]):::step B --> C([Modify code]):::step C --> D{{Run ruff + pytest}}:::checkNode D --> E([Push to Fork]):::step end E --> F([Open PR on GitHub]):::remoteBox F --> G([Review]):::remoteBox G --> H([Merge to main]):::successBox
# 1. Clone after forking
git clone https://github.com//PhyAgentOS.git
cd PhyAgentOS

# 2. Add upstream for syncing
git remote add upstream https://github.com/SYSU-HCP-EAI/PhyAgentOS.git

# 3. Create branch (see naming suggestions below)
git checkout -b feat/my-robot-driver

# 4. Push to your Fork after development
git push origin feat/my-robot-driver

# 5. Go to GitHub and click "Open Pull Request"
Branch naming reference:
  • feat/xxx — New feature / new driver
  • fix/xxx — Bug fix
  • docs/xxx — Documentation changes
  • refactor/xxx — Refactoring without behavior changes

Three Mandatory Pre-Commit Checks

It is recommended to complete checks locally first to avoid fixing CI failures after submission. All three checks are configured in pyproject.toml and can be executed directly.

🎨

Code Formatting

ruff check .
ruff format .
🧪

Unit Tests

pytest tests/
# Or run only related tests
pytest tests/test_hal_base_driver.py
📦

Install Dev Dependencies

pip install -e ".[dev]"
🔍

Type Checking (Recommended)

# Read through the method call sites you changed,
# confirm no obvious type mismatches

PR Description Standards

Please follow the template below when writing PR descriptions. Clear documentation helps accelerate the review process.

## What Changed
One-sentence summary + list key files and logic changes.

## How Verified
- What commands did you run locally? Results?
- Real/simulator verification logs or screenshots (required for driver/plugin)
- Does documentation render correctly (required for docs)

## Related Issue
Closes #123

Driver / Plugin PR

Must include: profile path, startup command, and at least one action execution record.

Bug Fix PR

Must explain: how to reproduce, root cause, and post-fix verification results. Reference the Issue if applicable.

Docs PR

Must explain: which pages changed, why, and what needs special attention.

Issue Categories: Align Before You Start

If you are unsure about the implementation approach, it is recommended to open an Issue for discussion first. Below are commonly used labels — correct labeling helps maintainers respond more quickly.

LabelWhen to UseBest to Include
bug Malfunction, crash, or behavior inconsistent with docs Reproduction steps, environment info, error logs
feature Want new capability, tool, or protocol field Use case, expected interface, willingness to implement
driver-request Want support for a new robot or hardware Device model, SDK availability, progress status
documentation Docs missing, wrong, or unclear Specific page, current content, suggested fix
good first issue Simple tasks suitable for newcomers Clear scope, reference to existing code

Merge Requirements

The purpose of review is to ensure the next person can understand and maintain the code. All four must be green before merging:

  • CI all green — Lint and tests must pass.
  • At least 1 Approve — Core architecture or protocol changes should wait for 2 Maintainers.
  • Self-explanatory — Complex logic should have comments or documentation.
  • No breaking changes to existing interfaces — Unless a migration plan is explained in the Issue/PR.
Large PRs may be requested to be split into smaller ones, to facilitate faster review and reduce rollback risk.

First Contribution? Start Here

No Hardware Needed

  • Fix documentation typos or dead links
  • Add test cases for existing drivers
  • Improve docs site styling or navigation

With Hardware, Even Better

  • Write a minimal driver + profile for a new robot
  • Contribute a ROS2 adapter template
  • Write a real-device deployment README