Skip to content
⚠️ This document is AI-translated. The Chinese version is the authoritative source.

Contributing Guide ​

As of March 2026. Contributions to the Presto ecosystem are welcome, whether you're fixing a typo or contributing a new feature.

Prerequisites ​

Before you start contributing, make sure your development environment is set up. Refer to the Environment Setup Guide to install the following tools:

  • Git
  • Node.js + npm
  • Go (if contributing to the Presto main repository)
  • VSCode + Claude Code (recommended AI-assisted development tools)

Verification: Run git --version && node --version && go version to confirm all tools are available.

Branching Strategy ​

All Presto repositories follow a single main branch strategy (simplified GitHub Flow model):

  • main is the only long-lived branch and is always kept in a releasable state
  • All development happens on short-lived feature branches created from main
  • There are no develop, release, or other extra branches

Feature branch naming convention:

PrefixPurposeExample
feat/New featurefeat/dark-mode
fix/Bug fixfix/pdf-export-crash
docs/Documentationdocs/update-glossary
refactor/Refactoringrefactor/template-engine

Development Workflow ​

Step 1: Fork the Repository ​

Fork the target repository to your account on GitHub.

Verification: You can see https://github.com/<your-username>/<repo-name> in your browser.

Step 2: Clone and Configure Upstream ​

bash
git clone https://github.com/<your-username>/<repo-name>.git
cd <repo-name>
git remote add upstream https://github.com/Presto-io/<repo-name>.git

Verification: git remote -v shows origin (your Fork) and upstream (Presto-io original repo).

Step 3: Create a Feature Branch ​

bash
git checkout main
git pull upstream main
git checkout -b feat/your-feature-name

Verification: git branch shows you're on the new branch.

Step 4: Develop and Commit ​

Follow the Commit Convention below for your changes. Small, focused commits are recommended --- each commit should do one thing.

Step 5: Push and Create a PR ​

bash
git push origin feat/your-feature-name

Then create a Pull Request on GitHub, targeting upstream/main.

Verification: You can see your PR on GitHub, and CI checks begin running.

Commit Convention ​

Commit messages use Chinese, in the format <type>: <description>.

TypePurposeExample
featNew featurefeat: add dark mode support
fixBug fixfix: fix CJK garbled text in PDF export
refactorRefactoring (no behavior change)refactor: extract template parser into separate module
uiUI adjustmentsui: adjust sidebar width
secSecurity-relatedsec: fix path traversal vulnerability
docsDocumentationdocs: update glossary
choreBuild/tooling/dependencieschore: upgrade Go to 1.23
mergeBranch mergemerge: merge feat/dark-mode

PR Workflow ​

The project currently doesn't have a PR template, but it is recommended that your PR description includes the following:

  1. What was done: Briefly describe the changes
  2. Why: Explain the motivation or related issue (if any)
  3. How to verify: Describe how to test your changes

Example:

markdown
## What was done

Added 3 missing terms to the glossary.

## Why

Users reported encountering unfamiliar terms while reading the template developer guide.

## How to verify

Run `npm run check` to confirm lint passes.

After submitting a PR:

  • Wait for CI checks to pass (if configured)
  • Wait for maintainer review
  • After addressing feedback, push to the same branch to automatically update the PR

Coding Conventions ​

Each repository has different tech stacks and convention requirements. For the complete AI development guide, refer to the AI Development Guide.

Presto Main Repository (Go) ​

  • Use gofmt to format code
  • Error handling: return error, don't use panic
  • Log format: log.Printf("[module] ...")
  • Security annotations: use // SEC-XX: comments to mark security-related code
  • Do not introduce new third-party Go dependencies (unless discussed in advance)

Presto Frontend (Svelte 5 + TypeScript) ​

  • Use Svelte 5 runes syntax ($state, $derived, $effect)
  • TypeScript strict mode
  • Components go in frontend/src/lib/components/
  • API clients go in frontend/src/lib/api/
  • State management uses .svelte.ts files

Presto-doc (Markdown) ​

  • Toolchain: markdownlint-cli2 + prettier + autocorrect
  • Line length limit: 120 characters (tables excluded)
  • Run npm run check before committing to confirm zero errors
  • The repository has a husky pre-commit hook configured that automatically checks staged files

First-Time Contribution Suggestions ​

Not sure where to start? Here are some beginner-friendly contribution ideas:

  1. Documentation fixes: Fix typos, outdated links, or inaccurate descriptions
  2. Dependabot PR Review: Help review auto-created dependency update PRs to confirm CI passes and there are no breaking changes
  3. User experience improvements: Based on your experience using Presto, suggest improvements or submit issues
  4. Add tests: Add test cases for existing features

Every contribution is valuable --- we look forward to your participation.

Presto — Markdown to PDF