# Contributing to ChordSketch **ChordSketch does not accept outside contributions.** The source is public so that anyone can read it, build it and use or fork it under the licences in this repository. It is not an invitation to send changes: pull requests from anyone other than the maintainers are not reviewed or merged and may be closed without a reply. Bug reports and questions can still be filed as issues (see below), without any promise of an answer. The rest of this document describes how the maintainers work. It is also the guide to building from source or working on a fork. ## Language Everything in this repository is in **English**: code, comments, documentation, commit messages, PR titles and descriptions, issue titles and issue bodies. ## Filing Issues - Check [existing issues](https://github.com/koedame/chordsketch/issues) before opening a new one. - Use a clear, imperative title (e.g., "Fix chord transposition for sharps"). - Issue bodies should include the following fields: - **Goal** — What should be achieved. - **Acceptance Criteria** — Checkboxes for done-ness. - **Phase** — Which roadmap phase this belongs to (if known). - For bugs, include steps to reproduce. For features, describe the desired behavior. - Labels: `phase:N`, `type:feature`/`type:bug`/`type:docs`/`type:refactor`, `size:small`/`size:medium`/`size:large`, `priority:high`/`priority:medium`/`priority:low`. ## Development Setup Requires **Rust 1.89** or later. ```bash git clone https://github.com/koedame/chordsketch.git cd chordsketch cargo build cargo test ``` ## Playground Development The web playground requires building the WASM crate first: ```bash # Install wasm-pack cargo install wasm-pack # Build WASM and copy artifacts wasm-pack build crates/wasm --target web cp crates/wasm/pkg/chordsketch_wasm* packages/npm/ # Start the playground dev server cd packages/playground npm install npm run dev ``` ## Making Changes (Maintainers) 1. **An issue is optional.** Open one when the change is worth discussing before it is written; a self-contained fix can go straight to a PR. 2. **Create a branch** named `issue-{number}-{short-description}` (e.g., `issue-42-fix-transpose`) when the change has an issue, or `{type}/{short-description}` (e.g., `fix/transpose-sharps`) when it does not. 3. **Make your changes.** Keep the scope focused — one topic per PR. 4. **Run checks before pushing:** ```bash cargo fmt # Auto-format cargo clippy # Lint (must pass with zero warnings) cargo test # All tests must pass ``` 5. **Open a PR.** Include `Closes #N` in the description when the PR resolves an issue. PRs are squash-merged. 6. **Click "Merge when ready".** This adds the PR to the merge queue, which runs the required checks on your change combined with the current `main` and squash-merges it when they pass. Your branch does not have to be up to date with `main`; rebase (`git rebase origin/main && git push --force-with-lease`) only to resolve a conflict. If the queue removes the PR, the failing check is linked from the PR; fix it, push, and queue it again. The publish checks (`Publishable`) run in full in the queue, and on the PR only when it touches packaging, so a PR can pass and still be removed by them. CI runs `cargo fmt --check`, `cargo clippy -- -D warnings`, and `cargo test` on every PR. A Claude-powered auto-review classifies findings by severity and may push fix commits directly. Those fix commits are authored as the maintainer. ## Code Style - Follow standard Rust conventions (`rustfmt` defaults, Clippy lints). - All public items must have doc comments. - Prefer `Result` over panicking. - Tests go in `#[cfg(test)] mod tests` or in a `tests/` directory for integration tests. ## Dependency Policy - **`chordsketch-chordpro`** must have **zero external dependencies**. No exceptions. - Renderer crates may use minimal external crates when justified. - New dependencies must be explained in the PR description. - Every dependency must be under a license listed in `deny.toml` (permissive licenses only; `cargo deny --all-features check licenses` checks it in CI). - `THIRD_PARTY_LICENSES.md` lists the copyright notices and license texts of the dependencies linked or bundled into the binaries, and ships with them. It is generated: when CI reports it out of date after a change to `Cargo.lock` or a bundled `package-lock.json`, run `python3 scripts/third-party-licenses.py --install` and commit the result (see the script's docstring for what it needs). ## Golden Tests Parser behavior is validated via golden tests: input `.cho` files paired with expected output snapshots in `crates/chordpro/tests/fixtures/`. New directives or syntax changes must include golden test coverage. ## Project Board Track progress and find available work on the [GitHub Project board](https://github.com/orgs/koedame/projects/1/views/1). ## License Outside contributions are not accepted, so there are no terms for them. The code is under the licence of the directory it is in, as the README's License section lists: the [MIT License](LICENSE) for most of the repository and the [GNU AGPL v3.0 only](apps/desktop/LICENSE) for `apps/desktop/`, `packages/playground/` and `packages/ui-irealb-editor/`. ## Trademark The MIT licence does not cover the ChordSketch name or logo. Using or forking the code needs no permission under its licence; naming something of your own after the project does. [TRADEMARK.md](TRADEMARK.md) has the boundary and the examples.