← Use spec sections guides

How to use the Forbids section

How-To Use spec sections Intermediate 1061010HOWTO-1061010

HOWTO-1061010Use spec sectionsIntermediate

This guide shows you how to use the Forbids section in a SpecDD .sdd file.

Forbids lists forbidden dependencies, paths, modules, libraries, tools, or architectural access. Use it when a boundary should block implementation choices, not just describe behavior.

Short answer

Use Forbids for blocked dependencies, paths, modules, libraries, tools, or access patterns. Use Must not for forbidden behavior and non-goals. Depends on, Must, and Tasks do not override inherited Forbids.

Syntax

Forbids:
  ../booking/*
  ../destinations/editor/*
  Direct booking API access from itinerary behavior.

Rules:

Steps

1. Block concrete dependencies or access

Good:

Forbids:
  ../booking/*
  Direct browser storage writes from itinerary behavior.

These rules tell contributors what implementation paths are off limits.

2. Use explicit paths for file boundaries

Good:

Forbids:
  ../booking/*

Weak:

Forbids:
  booking

The weak version may be useful as prose, but it is not an explicit path reference.

3. Keep behavior boundaries in Must not

Use Must not for behavior:

Must not:
  Change destination search ranking.

Use Forbids for dependency or path access:

Forbids:
  ../destinations/ranking/*

Often both are useful.

4. Check Depends on conflicts

This is invalid as a contract:

Forbids:
  ../booking/*

Depends on:
  ../booking/api.js

Depends on does not override Forbids. Resolve the conflict before implementation.

5. Review removals and weakenings carefully

Removing a Forbids entry changes future implementation authority. Treat it as a boundary change, especially when it affects security, data, runtime access, dependency direction, or public behavior.

Common mistakes

How to verify the result

The Forbids section is effective when:

← Use spec sections guides