|
| 1 | +<!-- |
| 2 | + Copyright 2026 UCP Authors |
| 3 | +
|
| 4 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + you may not use this file except in compliance with the License. |
| 6 | + You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | + Unless required by applicable law or agreed to in writing, software |
| 11 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + See the License for the specific language governing permissions and |
| 14 | + limitations under the License. |
| 15 | +--> |
| 16 | + |
| 17 | +# How to Contribute |
| 18 | + |
| 19 | +We would love to accept your patches and contributions to this project. |
| 20 | + |
| 21 | +## Before you begin |
| 22 | + |
| 23 | +### Sign our Contributor License Agreement |
| 24 | + |
| 25 | +Contributions to this project must be accompanied by a |
| 26 | +[Contributor License Agreement](https://cla.developers.google.com/about) (CLA). |
| 27 | +You (or your employer) retain the copyright to your contribution; this simply |
| 28 | +gives us permission to use and redistribute your contributions as part of the |
| 29 | +project. |
| 30 | + |
| 31 | +If you or your current employer have already signed the Google CLA (even if it |
| 32 | +was for a different project), you probably don't need to do it again. |
| 33 | + |
| 34 | +Visit <https://cla.developers.google.com/> to see your current agreements or to |
| 35 | +sign a new one. |
| 36 | + |
| 37 | +### Review our Community Guidelines |
| 38 | + |
| 39 | +This project follows [Google's Open Source Community |
| 40 | +Guidelines](https://opensource.google/conduct/). |
| 41 | + |
| 42 | +## Other Ways to Contribute |
| 43 | + |
| 44 | +### Reporting Issues |
| 45 | + |
| 46 | +If you find a bug, a mistake in the documentation, or have a feature request, |
| 47 | +please open an issue. |
| 48 | +This helps us track problems and improve the project. |
| 49 | + |
| 50 | +### Discussions |
| 51 | + |
| 52 | +If you want to start a conversation, share an idea, or ask a question, feel free |
| 53 | +to use GitHub Discussions. |
| 54 | + |
| 55 | +## Contribution Process |
| 56 | + |
| 57 | +### Significant Changes |
| 58 | + |
| 59 | +Any significant change to the protocol requires a formal |
| 60 | +[Enhancement Proposal](../../issues/new?template=enhancement-proposal.md) |
| 61 | +and will require Tech Council (TC) approval. Because a change to the protocol |
| 62 | +requires the entire adopting ecosystem to implement the change, we consider |
| 63 | +significant changes to include: |
| 64 | + |
| 65 | +- Core Schema Modifications: Any change to JSON schemas, including |
| 66 | + adding/updating fields or field descriptions |
| 67 | +- Protocol Changes: Alterations to communication flows or expected behaviors of |
| 68 | + operations |
| 69 | +- New API Endpoints: Introduction of entirely new capabilities or services. |
| 70 | +- Backwards Incompatibility: Any "breaking" change that requires a major version |
| 71 | + increment. |
| 72 | + |
| 73 | +An [Enhancement Proposal](../../issues/new?template=enhancement-proposal.md) |
| 74 | +is a living artifact that tracks a proposal through its lifecycle: |
| 75 | + |
| 76 | +- **Proposal:** Anyone can submit; idea is proposed and debated. |
| 77 | +- **Provisional:** TC majority vote to accept; enters working draft iteration. |
| 78 | +- **Implemented:** TC majority vote to finalize; code complete and merged. |
| 79 | + |
| 80 | +Every [Enhancement Proposal](../../issues/new?template=enhancement-proposal.md) |
| 81 | +must follow a standard template requiring sections for a Summary, Motivation, |
| 82 | +Detailed Design, Risks, a Test Plan, and Graduation Criteria. This creates a |
| 83 | +permanent, public design record for the project's evolution. |
| 84 | + |
| 85 | +### Capability Maturity Levels |
| 86 | + |
| 87 | +After an Enhancement Proposal reaches "Provisional" status, the capability |
| 88 | +enters the maturity lifecycle with the following stability guarantees: |
| 89 | + |
| 90 | +#### Working Draft |
| 91 | + |
| 92 | +- **Version:** `Working Draft` |
| 93 | +- **Stability:** Breaking changes expected |
| 94 | +- **Status:** Prototyping, gathering feedback, iterating on design |
| 95 | +- **Exit criteria:** TC majority vote to advance |
| 96 | + |
| 97 | +#### Candidate |
| 98 | + |
| 99 | +- **Version:** `Candidate` |
| 100 | +- **Stability:** API surface stable; implementation details may evolve |
| 101 | +- **Status:** Early adopter implementations, production pilots |
| 102 | +- **Exit criteria:** TC majority vote to advance |
| 103 | + |
| 104 | +#### Stable |
| 105 | + |
| 106 | +- **Version:** `YYYY-MM-DD` (date-based version assigned) |
| 107 | +- **Stability:** Full backward compatibility within major version |
| 108 | +- **Status:** Production deployments |
| 109 | + |
| 110 | +### Voting and decision making |
| 111 | + |
| 112 | +The path below should be followed for resolving issues that are technical in |
| 113 | +nature. |
| 114 | + |
| 115 | +- L1: routine changes (bug fixes, documentation, minor improvements) require |
| 116 | + approval from at least 2 Maintainers. |
| 117 | +- L2: Any technical issues that span across topics and/or cannot be resolved |
| 118 | + amongst maintainers and DWGs will be escalated to the TC. Significant changes |
| 119 | + affecting core protocol architecture must follow the Enhancement Proposal |
| 120 | + process, requiring TC approval before implementation. |
| 121 | +- L3: Any changes made to the Governance process (e.g updating the |
| 122 | + [GOVERNANCE.md](GOVERNANCE.md) file) or any changes that impact the core |
| 123 | + protocol’s scope or adoption, must be approved by Governance Council (GC). |
| 124 | + |
| 125 | +The TC reserves the right to stop any discussions deemed non-critical to the |
| 126 | +protocol. |
| 127 | + |
| 128 | +### Versioning |
| 129 | + |
| 130 | +The base protocol uses date based versioning. Major version increments (breaking |
| 131 | +changes) require a majority Governing Council approval due to the high cost to |
| 132 | +the ecosystem. A quorum requires all Governing Council members (or appropriate |
| 133 | +representatives) to be present for decision-making. New features should |
| 134 | +typically be attempted through the extensions framework first. If an extension |
| 135 | +achieves significant usage, it can be considered for adoption into the next |
| 136 | +minor version of the core. |
| 137 | + |
| 138 | +### Adding new extensions and capabilities to the core protocol |
| 139 | + |
| 140 | +UCP is designed to be extensible while keeping the core protocol light. A |
| 141 | +core principle of UCP is to ensure that the set of extensions and capabilities |
| 142 | +defined in UCP have broad ecosystem support. Vendors should first create |
| 143 | +capabilities & extensions in vendor-specific namespace pattern |
| 144 | +(e.g. com.{vendor}.\*) for new use cases. Requests to add new capabilities and |
| 145 | +extensions should only be submitted when there is proven widespread adoption of |
| 146 | +vendor-specific capabilities and extensions. See |
| 147 | +[Spec URL Binding](https://ucp.dev/specification/overview/#spec-url-binding) |
| 148 | +and [Governance Model](https://ucp.dev/specification/overview/#governance-model) |
| 149 | +for more details on using namespace pattern for creating vendor-specific |
| 150 | +capabilities and extensions. |
| 151 | + |
| 152 | +### Code Reviews |
| 153 | + |
| 154 | +All submissions, including submissions by project members, require review. We |
| 155 | +use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests) |
| 156 | +for this purpose. |
| 157 | + |
| 158 | +### Pull Request Titles and Commit Messages |
| 159 | + |
| 160 | +This repository enforces **Conventional Commits** for Pull Request titles. |
| 161 | +Your PR title must follow this format: `type: description`. If your change |
| 162 | +is a breaking change (e.g., removing a schema field or file), you **must** |
| 163 | +add `!` before the colon: `type!: description`. |
| 164 | + |
| 165 | +**Common Types:** |
| 166 | + |
| 167 | +- `feat`: A new feature |
| 168 | +- `fix`: A bug fix |
| 169 | +- `docs`: Documentation only changes |
| 170 | +- `style`: Changes that do not affect the meaning of the code |
| 171 | +- `refactor`: A code change that neither fixes a bug nor adds a feature |
| 172 | +- `perf`: A change to the code that improves performance |
| 173 | +- `test`: Adding missing tests or correcting existing tests |
| 174 | +- `chore`: Changes to the build process or auxiliary tools and libraries |
| 175 | + |
| 176 | +**Examples:** |
| 177 | + |
| 178 | +- `feat: add new payment gateway` |
| 179 | +- `fix: resolve crash on checkout` |
| 180 | +- `docs: update setup guide` |
| 181 | +- `feat!: remove deprecated buyer field from checkout` |
| 182 | + |
| 183 | +### Linting and Automated Checks |
| 184 | + |
| 185 | +We use linters and automated checks to maintain code quality and consistency. |
| 186 | +These checks run automatically via GitHub Actions when you open a pull request. |
| 187 | +Your pull request must pass all checks before it can be merged. |
| 188 | + |
| 189 | +You can run many of these checks locally before committing by installing and |
| 190 | +using `pre-commit`: |
| 191 | + |
| 192 | +```bash |
| 193 | +uv tool install pre-commit |
| 194 | +pre-commit install |
| 195 | +``` |
| 196 | + |
| 197 | +This will set up pre-commit hooks to run automatically when you `git commit`. |
| 198 | + |
| 199 | +You can also run [super-linter](https://github.com/super-linter/super-linter) |
| 200 | +locally by running `./scripts/super_linter_local.py`. This assumes you have |
| 201 | +either [docker](https://www.docker.com/) or [podman](https://podman.io/) |
| 202 | +installed on your system. |
| 203 | + |
| 204 | +### Submitting a Pull Request |
| 205 | + |
| 206 | +1. Fork the repository and create your branch from `main`. |
| 207 | +2. Make your changes, ensuring you follow the setup instructions below. |
| 208 | +3. If you've installed `pre-commit`, it will run checks as you commit. |
| 209 | +4. Ensure your pull request title follows the Conventional Commits format. |
| 210 | +5. Fill out the pull request template in GitHub, providing details about |
| 211 | + your change. |
| 212 | +6. Push your branch to GitHub and open a pull request. |
| 213 | +7. Address any automated check failures or reviewer feedback. |
| 214 | + |
| 215 | +## Local Development Setup |
| 216 | + |
| 217 | +### Schema Development |
| 218 | + |
| 219 | +Schemas live in `source/` and are published with `ucp_*` annotations intact. |
| 220 | +Agents use [ucp-schema](https://github.com/universal-commerce-protocol/ucp-schema) |
| 221 | +to resolve annotations for specific operations at runtime. |
| 222 | + |
| 223 | +1. Ensure `ucp-schema` is installed: |
| 224 | + |
| 225 | + ```bash |
| 226 | + cargo install ucp-schema # from crates.io |
| 227 | + cargo install --git https://github.com/universal-commerce-protocol/ucp-schema # from git |
| 228 | + ``` |
| 229 | + |
| 230 | +2. Make updates to JSON files in `source/` |
| 231 | +3. Run `ucp-schema lint source/` to validate syntax and references |
| 232 | + |
| 233 | +If you change any JSON schemas, you may need to regenerate SDK client libraries. |
| 234 | +For example, to regenerate Python Pydantic models run |
| 235 | +`bash sdk/python/generate_models.sh`. Our CI system runs |
| 236 | +`scripts/ci_check_models.sh` to verify that models can be generated |
| 237 | +successfully from the schemas. |
| 238 | + |
| 239 | +### Documentation Development |
| 240 | + |
| 241 | +This project uses [uv](https://docs.astral.sh/uv/) for Python dependency management. |
| 242 | + |
| 243 | +1. Install Python dependencies: `uv sync` |
| 244 | +2. Ensure `ucp-schema` is installed (see above) |
| 245 | +3. Run the development server: `uv run mkdocs serve --watch source` |
| 246 | +4. Open **<http://127.0.0.1:8000>** in your browser |
| 247 | +5. Before submitting, run `uv run mkdocs build --strict` to check for warnings/errors |
0 commit comments