← Use spec sections guides

How to use the Can modify section

How-To Use spec sections Intermediate 1061005HOWTO-1061005

HOWTO-1061005Use spec sectionsIntermediate

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

Can modify lists files or paths that may be changed when work is performed under the spec. It is the clearest section for bounded implementation work, especially with agents.

Short answer

Use Can modify when writable scope should be explicit, narrower than ownership, or different from ownership. List only the files or paths that may change. Put read-only context in Can read or References. During review, every changed file should map to Can modify, unless the spec itself was intentionally updated.

Syntax

Can modify:
  ./itinerary.js
  ./itinerary.test.js
  ./fixtures/*

Rules:

Steps

1. Decide whether Owns is enough

If the spec owns exactly the files it may change, Owns may be enough:

Owns:
  ./itinerary.js
  ./itinerary.test.js

When Can modify is absent, Owns acts as the modification boundary.

Add Can modify when:

2. List writable files explicitly

Good:

Can modify:
  ./itinerary.js
  ./itinerary.test.js

Risky:

Can modify:
  ../trips/*

Broad patterns are sometimes valid, but they should be deliberate and reviewable.

3. Separate context from permission

If implementation needs to inspect storage behavior:

Can modify:
  ./itinerary.js
  ./itinerary.test.js

Can read:
  ../storage/trip-storage.sdd

The storage spec is read context, not writable authority.

4. Use Must not and Forbids for tempting overreach

If agents or contributors keep editing nearby areas, add boundaries:

Must not:
  Change destination search behavior.

Forbids:
  ../booking/*

Can modify says what may change. Must not and Forbids protect likely mistakes.

5. Review every changed file

During review, ask:

Common mistakes

How to verify the result

The Can modify section is working when:

← Use spec sections guides