Skip to content

Contributing

Thanks for your interest in contributing to Stoneforge! Whether you’re fixing a bug, adding a feature, improving documentation, or writing tests, this guide has everything you need to get started.

Prerequisites

Before you begin, make sure you have:

  • Node.js 18+ (for building and running dev servers)
  • pnpm 8.15+ (the monorepo package manager)
  • Bun (for running tests)
  • Git (for cloning and branching)

Development setup

  1. Fork and clone the repository

    Terminal window
    git clone https://github.com/stoneforge-ai/stoneforge.git
    cd stoneforge
  2. Install dependencies

    Terminal window
    pnpm install
  3. Verify everything builds

    Terminal window
    npx turbo run typecheck
  4. Start the dev server (most common workflow)

    Terminal window
    # Orchestrator only (smithy-server + smithy-web)
    pnpm dev:smithy
    # Everything (all 4 services)
    pnpm dev

Project structure

PackageDescriptionKey exports
packages/coreCore types, errors, ID generationElementType, Task, Entity, ErrorCode
packages/storageSQLite storage (Bun/Node/browser)createStorage, initializeSchema
packages/quarrySDK, API, services, sync, CLIQuarryAPI, SyncService, CLI commands
packages/smithyAgent orchestration libraryOrchestratorAPI, SpawnerService
packages/uiShared React 19 componentsButton, Card, TaskCard, charts, hooks
packages/shared-routesShared Hono route factoriescreateElementsRoutes, createEntityRoutes
apps/smithy-serverOrchestration API server (port 3457)
apps/smithy-webAgent management dashboard (port 5174)
apps/quarry-serverCore API server (port 3456)
apps/quarry-webElement management dashboard (port 5173)

Running tests

Tests use Bun as the test runner. Run them per-package:

Terminal window
cd packages/core && bun test src
cd packages/storage && bun test src
cd packages/quarry && bun test src
cd packages/smithy && bun test src

Making changes

  1. Create a feature branch from master

    Terminal window
    git checkout -b feat/my-feature master
  2. Make your changes — keep commits focused and descriptive

  3. Add a changeset if your change affects published packages

    Terminal window
    pnpm changeset

    The changeset CLI will walk you through selecting affected packages and writing a summary. Create one changeset file per affected package.

  4. Ensure typecheck and tests pass

    Terminal window
    npx turbo run typecheck
    bun test src # in the relevant package directory
  5. Submit a pull request against master

Coding standards

Stoneforge follows strict conventions across the codebase:

TypeScript strict mode

All packages use strict TypeScript. No any types, no implicit returns, no unchecked nulls.

Branded IDs

Always use branded IDs from @stoneforge/core — never raw strings for entity or element IDs. This prevents accidentally passing the wrong ID type.

Event-sourced data

Create events, not mutable state. Data changes are appended to JSONL files and materialized into SQLite. Never mutate SQLite directly.

Minimal dependencies

Keep the dependency footprint small. Prefer standard library APIs and existing internal utilities over adding new packages.

What to contribute

Not sure where to start? Here are some high-impact areas:

  • Bug fixes — check open issues labeled bug
  • Documentation — fix inaccuracies, add examples, improve clarity
  • Tests — increase coverage, especially for edge cases in orchestration flows
  • Provider integrations — improve OpenCode or Codex provider support
  • Dashboard UX — improve the web dashboard components in packages/ui or apps/smithy-web

Contributor License Agreement (CLA)

All contributors must sign a Contributor License Agreement before their first pull request can be merged. The CLA bot will automatically comment on your PR with instructions when you submit it.

If you’re contributing on behalf of an employer, ask for the Corporate CLA so we can add your GitHub username(s) to the authorized list.

Code of Conduct

We are committed to providing a welcoming and inclusive experience for everyone. All participants are expected to follow the Contributor Covenant Code of Conduct.

In short:

  • Use welcoming and inclusive language
  • Be respectful of differing viewpoints and experiences
  • Gracefully accept constructive criticism
  • Focus on what is best for the community

Report unacceptable behavior to conduct@stoneforge.ai. All complaints are reviewed promptly and confidentially.

Security vulnerabilities

Found a security issue? Do not open a public issue.

Email security@stoneforge.ai with:

  • Description of the vulnerability
  • Steps to reproduce
  • Potential impact
TimelineCommitment
AcknowledgmentWithin 48 hours
Initial assessmentWithin 1 week
Fix timelineDepends on severity, typically within 30 days

We consider security research conducted in good faith to be authorized. See our full Security Policy for details.

License

Stoneforge is licensed under Apache 2.0 across all packages. Your contributions are licensed under the same terms.

Get help