← Write specs by level guides

How to write a repository spec

How-To Write specs by level Advanced 1051013HOWTO-1051013

HOWTO-1051013Write specs by levelAdvanced

This guide shows you how to write a SpecDD repository spec for a spec-driven development workflow.

A repository spec is usually the root spec for a repository or monorepo content root. It describes repository-level architecture and boundaries above apps, packages, services, or documentation trees.

Short answer

If the repository is the selected content root, write the repository spec as the root spec named after the repository directory. Use it for top-level purpose, structure, shared architecture boundaries, package or app roles, and broad constraints. Put build commands, naming conventions, syntax rules, and team process in .specdd/bootstrap.project.md.

When to use this guide

Use this guide when:

Steps

1. Identify the content root

For a repository named:

travel-platform/

the root repository spec is:

travel-platform.sdd

When packages or apps are configured as independent SpecDD projects, they may have their own root specs. Otherwise, the repository root spec provides inherited context for the hierarchy.

2. Describe repository purpose

Spec: Travel Platform

Purpose:
  Host travel planning applications, shared packages, and repository-level automation.

Keep it repository-level.

3. Describe top-level structure

Structure:
  ./apps: Deployable applications
  ./packages: Shared packages
  ./docs: Repository documentation
  ./tools: Repository automation

This helps humans and agents find the right local specs.

4. Define broad architecture boundaries

Must:
  Shared packages remain reusable by apps.
  Apps own product-specific wiring.

Must not:
  Shared packages depend on app UI code.
  Repository automation change application behavior directly.

Forbids:
  ./packages/* importing ./apps/*

Use top-level rules only when they should apply broadly.

5. Keep conventions in bootstrap.project.md

Do not put these in the repository spec:

Put them in:

.specdd/bootstrap.project.md

The repository spec is for durable repository architecture and behavior, not project instruction boilerplate.

6. Delegate local behavior

Use child specs for:

Do not put every package’s local behavior in the repository spec.

Complete example

Spec: Travel Platform

Purpose:
  Host travel planning applications, shared packages, and repository-level automation.

Structure:
  ./apps: Deployable applications
  ./packages: Shared packages
  ./docs: Repository documentation
  ./tools: Repository automation

Must:
  Shared packages remain reusable by apps.
  Apps own product-specific wiring.
  Repository-level automation stays separate from application behavior.

Must not:
  Shared packages depend on app UI code.
  Repository automation change application behavior directly.

Forbids:
  ./packages/* importing ./apps/*

Common mistakes

How to verify the result

The repository spec is useful when:

← Write specs by level guides