Overview

A kit is a reusable .dog spec template. Users run dotdog kit init <name> and dotdog copies the kit into specs/<name>/ so they can start from a complete domain model instead of a blank project.

Built-in kits live in:

packages/dotdog/kits/<name>/

Every built-in kit must include:

SPEC.dog
constitution.dog
data-model.dog

File Structure

Use a short lowercase directory name:

packages/dotdog/kits/dao/
  SPEC.dog
  constitution.dog
  data-model.dog

SPEC.dog describes the product, user flows, screens, and user stories. Keep it concrete enough that a new user can understand what the kit scaffolds.

constitution.dog defines rules, constraints, and invariants. These are the promises the generated project should preserve.

data-model.dog defines entities, properties, states, lifecycles, and relationships. This file is what agents query most often after dotdog compile.

Writing Entities

Use a heading, a short description, and a fenced YAML block:

### Entity: Proposal

A governance proposal that members can vote on.

```yaml
entity: Proposal
type: entity
properties:
  id:
    type: string
    required: true
  title:
    type: string
    required: true
  status:
    type: enum
    required: true
states: [draft, active, passed, rejected, executed]
lifecycle: draft → active → passed → executed
```

Rules:

Writing Relationships

Use the Unicode arrow in relationship headings:

### Relationship: Member → Vote

```yaml
relationship: Member → Vote
verb: casts
cardinality: 1:N
required: true
```

Rules:

Testing a Kit

From the repo root, initialize the kit in a temporary directory:

tmp=$(mktemp -d)
cd "$tmp"
bun /path/to/dotdog/packages/dotdog/src/cli.ts kit init dao
bun /path/to/dotdog/packages/dotdog/src/cli.ts validate
bun /path/to/dotdog/packages/dotdog/src/cli.ts compile

From inside the dotdog repo, run the full test suite too:

bun test
bun packages/dotdog/src/cli.ts validate
bun packages/dotdog/src/cli.ts compile

The CLI test suite initializes every built-in kit and verifies that each generated project contains SPEC.dog, constitution.dog, and data-model.dog, then runs validate.

Pull Request Checklist

Example

See packages/dotdog/kits/dao/ for a minimal community-governance kit with members, proposals, votes, and treasury allocations.