Skip to content
Website

Contributing & Extending

This guide is for contributors extending Patchwork features.

  1. Edit src/db/schema.ts.
  2. Generate plain SQL migration files:
    Terminal window
    npm run db:generate
  3. Apply migrations locally:
    Terminal window
    npm run db:migrate
  4. Regenerate docs so Database Schema updates:
    Terminal window
    npm run docs:generate
  1. Add the command definition to RAW_COMMANDS in src/lib/commands/registry.ts (metadata, args, options, minRole, examples). Usage strings are built automatically by formatUsage().
  2. Implement client/server execution in src/components/CommandPalette.tsx and src/app/api/commands/execute/route.ts.
  3. Run npm run docs:generate and npm run docs:check (which fails if any registered command is undocumented).
  1. Add the field with .min()/.max()/.default() in src/lib/settings.ts.
  2. Expose the control in src/components/SystemConfigView.tsx.
  3. Run npm run docs:generate and npm run docs:check.

Documentation is part of the definition of done. Every user-visible change must update the matching page in docs-site/, run npm run docs:generate, add an entry under ## [Unreleased] in CHANGELOG.md, and pass npm run docs:check and npm run docs:build.

  • Never hardcode version numbers; use src/lib/version.ts (app) or scripts/lib/version.mjs (scripts) and display v + SemVer (for example v0.7.0-beta).
  • Run npm run version:check to verify consistency across package.json, lockfiles, docs-site/, README.md, CHANGELOG.md, and documentation-dist/.build-info.json.
  • To prepare a release bump, run npm run release:prepare -- <version>. It updates package manifests and lockfiles, rolls CHANGELOG.md and the docs changelog page, runs checks, and prints the git commit and git tag commands without executing git.
  • MinIO is the only attachment storage: Never replace MinIO with local filesystem storage or another backend, and never add a STORAGE_DRIVER or storage-driver abstraction.
  • Default prerequisites stay minimal: The default Easy install path must require only Node.js 20+ and git. Any new runtime dependency, service, or system requirement must be provisioned automatically by the installer in Easy mode, documented, SHA-256 verified if downloaded, and covered by tests/easy-install.test.ts.