# Contributor Guide
> How to build, test, and contribute to CGraph.
[Source](https://open.nxtsoft.io/docs/cgraph/contributing)

CGraph is open source and built from source. This guide covers the build, the
tests, and what a good contribution looks like.

## Build from source

CGraph uses CMake and vcpkg. The full prerequisites and commands are on the
[Installation](/docs/cgraph/installation) page; the short version:

**build and test**

```bash
export VCPKG_ROOT="/path/to/your/vcpkg"
cmake --preset default
cmake --build --preset default
ctest --preset default
```

## Tests

The repository carries two test layers:

```text
tests/smoke/   CTest smoke coverage (run by ctest --preset default)
tests/fuzz/    optional libFuzzer targets
```

Run the smoke suite with `ctest --preset default` before opening a PR; it's the
fast gate that a change hasn't broken the core paths.

## What a good contribution looks like

  **Pick an issue** — 01

    Browse open issues; good-first-issue labels mark friendly entry points.
  
  **Fork and build** — 02

    Clone, configure with CMake + vcpkg, and run the smoke suite to verify your setup.
  
  **Open a PR** — 03

    Keep extraction deterministic, add smoke coverage for new behavior, and the review will move quickly.
  

The most important invariant to preserve is **determinism**: the same tree must
produce the same graph. A change that makes extraction non-deterministic breaks
incremental updates and background persistence — add smoke coverage that would
catch it.

## Where the code lives

See [Architecture](/docs/cgraph/architecture) for the repository layout —
`src/cli`, `src/daemon`, `src/client`, `src/mcp`, and the `src/engine` core.
