Files
Tunglies 37fa9b65fa ci: add AI-collaboration contract and PR gates for slop review
Codify the rules agents and contributors are judged by: a tracked
AGENTS.md instruction contract, a Contribution Expectations section in
CONTRIBUTING, and a minimal PR template. Align the AI-slop review
policy with them - linkage substance, test/defensive-code padding,
write-access skips, disclosure as transparency - and add two
tamper-resistant checks: an ai-slop:high merge gate with a linked-issue
requirement (no-issue-needed exemption), plus a docs-consistency anchor
check guarding the cross-references.
2026-09-08 14:13:58 +08:00

5.5 KiB

CONTRIBUTING

Thank you for your interest in contributing to Clash Verge Rev! This guide provides instructions to help you set up your development environment and start contributing effectively.

Internationalization (i18n)

We welcome translations and improvements to existing locales. For details on contributing translations, please see CONTRIBUTING_i18n.md.

Contribution Expectations

We welcome AI-assisted contributions — AI assistance itself is not a problem. What we require is ownership: every pull request must show that the stated problem is understood and that the change deliberately solves it. Incoming pull requests from contributors without write access are screened by an automated review (pr-ai-slop-review) that evaluates this ownership evidence and may label high-risk submissions ai-slop:med or ai-slop:high. The policy is maintained in that file and compiled into pr-ai-slop-review.lock.yml (gh aw compile); never edit the lock file by hand. If you want to adjust the review policy, the easiest path is directing an AI coding agent to make the change — the workflow is documented in AGENTS.md.

To make sure your contribution is assessed fairly:

  • Link a pre-existing issue. Non-trivial changes should fix or implement something already reported in an issue. An issue created after the pull request is a much weaker signal than a genuine problem report.
  • Keep the diff mapped to the issue. Every changed area should be explainable from the linked issue. Unrelated refactors, formatting churn, or dependency bumps belong in separate pull requests with their own motivation.
  • Describe the problem in your own words. A short statement of what breaks or what is needed, and why this approach fixes it, is worth more than a long generated report.
  • Validate against the reported behavior. Show how the reported problem was reproduced and confirmed fixed. Generic checklists and raw tool output are not verification.
  • Do not pad with tests or defensive code. New tests are not expected by default. Add them only when the linked issue calls for them, keep them minimal, and explain in the pull request why each is necessary; speculative error handling and coverage of hypothetical failure modes inflate the diff without adding value.
  • Disclose AI automation. If an AI agent produced or co-produced the change, end the pull request body with the model and effort level (for example, Assisted by: GPT-5.6 High; effort is optional when your tool does not report it). The PR template intentionally omits this footer; agents add it themselves. Disclosure is transparency only — it does not affect how the change is assessed.

If your pull request receives an ai-slop label, the fastest way to clear it is substantive: link (or ask us to create) the underlying issue, narrow the scope, or push implementation changes that respond to review feedback. Editing the pull request description alone does not change the assessment.

Development Setup

Before contributing, you need to set up your development environment. Follow the steps below carefully.

Prerequisites

  1. Install Rust and Node.js
    Our project requires both Rust and Node.js. Follow the official installation instructions here.

Windows Users

Note

Windows ARM users must also install LLVM (including clang) and set the corresponding environment variables.
The ring crate depends on clang when building on Windows ARM.

Additional steps for Windows:

  • Ensure Rust and Node.js are added to your system PATH.

  • Install the GNU patch tool.

  • Use the MSVC toolchain for Rust:

rustup target add x86_64-pc-windows-msvc
rustup set default-host x86_64-pc-windows-msvc

Install Node.js Package Manager

Enable corepack:

corepack enable

Install Project Dependencies

Node.js dependencies:

pnpm install

Ubuntu-only system packages:

sudo apt-get install -y libxslt1.1 libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf

Download the Mihomo Core Binary (Automatic)

pnpm run prebuild
pnpm run prebuild --force  # Re-download and overwrite Mihomo core and service binaries

Run the Development Server

pnpm dev           # Standard
pnpm dev:diff      # If an app instance already exists
pnpm dev:tauri     # Run Tauri development mode

Build the Project

Standard build:

pnpm build

Fast build for testing:

pnpm build:fast

Clean Build

pnpm clean

Portable Version (Windows Only)

pnpm portable

Contributing Your Changes

Before Committing

Code quality checks:

# Rust backend
cargo clippy-all
# Frontend
pnpm lint

Code formatting:

# Rust backend
cargo fmt
# Frontend
pnpm format

Signing your commit

Signed commits are required to verify authorship and ensure your contributions can be merged. Reference signing-commits here.

Submitting Your Changes

  1. Fork the repository.

  2. Create a new branch for your feature or bug fix.

  3. Commit your changes with clear messages and make sure it's signed.

  4. Push your branch and submit a pull request.

We appreciate your contributions and look forward to your participation!