Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Something doesn't behave the way the engine promises
labels: bug
---

## SSCCE

A **Short, Self-Contained, Correct (Compilable) Example** — the smallest
`setup()`/`machine()` config that still reproduces the bug, with nothing to
install or assume. Paste it as a single block; we should be able to copy it,
run it, and see the bug with zero edits.

```ts
// paste your minimal repro here
```

## Expected

What you expected it to do.

## Actual

What it actually did.

## Version

- `@dunky.dev/*` version:
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Question or discussion
url: https://github.com/dunky-dev/state-machine/discussions
about: Not a bug? Start a discussion instead.
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Why/What

<!-- Why this change, and what it does — a sentence or two. -->

# Changes

<!-- The change itself, in a few words. -->

# Issues

<!-- Link related issues, e.g. Closes #123 -->
72 changes: 72 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Contributing

For the contribution _workflow_, code conventions, and boundaries, see [`AGENTS.md`](./AGENTS.md) — it's the same
contract agents follow here, and it applies to you too.

## Setup

```bash
git clone git@github.com:dunky-dev/state-machine.git
cd state-machine
nvm use
corepack enable
pnpm install
```

## Commands

| Command | What it does |
| ------------------------------ | ---------------------------------------------------------- |
| `pnpm test` | Full test suite, watch mode |
| `pnpm test:ci` | Full test suite, once |
| `pnpm typecheck` | `tsc -b` across the whole workspace |
| `pnpm lint` | `oxlint` |
| `pnpm format` / `format:check` | `oxfmt` |
| `pnpm build` | Build every publishable package |
| `pnpm changeset` | Add a changeset — see [Versioning](./AGENTS.md#versioning) |

Target one package or one file instead of the whole workspace:

## Sandbox

Each sandbox renders the same command-palette machine on a different
substrate — the fastest way to see a change actually work end to end. See
[`sandbox/README.md`](./sandbox/README.md) for what each one demonstrates;
the short version:

```bash
pnpm -C sandbox/react dev
pnpm -C sandbox/opentui dev # terminal — needs Bun
pnpm -C sandbox/native dev # Expo — needs a simulator or device
```

## Filing an issue

A bug report is only as useful as its reproduction. Use an **SSCCE** — Short,
Self-Contained, Correct (Compilable) Example:

- **Short** — the smallest machine config that still reproduces it. Strip
every state, guard, and action that isn't load-bearing.
- **Self-contained** — no missing imports, no "assume you have X set up."
Someone should be able to paste it and run it with nothing else.
- **Correct (compilable)** — it actually runs and actually reproduces the
bug. Not what you _think_ is happening — what you pasted and ran.

The [bug report template](.github/ISSUE_TEMPLATE/bug_report.md) asks for
exactly this. If you can't shrink your repro to an SSCCE, that's often a sign
the bug isn't where you think it is — shrinking it is frequently how you find
the real cause yourself.

## Pull requests

### Humans

When using AI to help write changes, read the diff like you wrote it yourself
before asking someone else to. Cut comments that don't say anything, drop
anything that drifted from what you're actually fixing, and be able to
explain any line if asked. A reviewer's time isn't free.

### AI

Before opening it, make sure tests, lint, and typecheck pass, and a changeset is
included — see `AGENTS.md`'s RECONCILE step.
Loading