Build System Abstraction

Requirement

DIDP is designed to be tool-agnostic. The protocol should apply equally whether your project uses:

  • TypeScript with Bun
  • Swift with Xcode
  • Python with Poetry
  • Rust with Cargo
  • Fish shell scripts
  • Any other build system

Approach

Build Interface (Conceptual)

DIDP defines a conceptual Build Interface with these operations:

OperationPurpose
configureSet up build environment and dependencies
buildCompile/transpile/bundle the project
testRun automated tests
lintCheck code quality and style
packageCreate distributable artifacts

Environment Selection

The concrete build backend can be selected via:

  1. .env file in project root
  2. Environment variables ($BUILD_SYSTEM, etc.)
  3. Explicit configuration file
  4. Convention-based detection (presence of package.json, Cargo.toml, etc.)

Default Implementation

When a concrete build backend is needed and none is specified, Ninja serves as the default/fallback example. This choice is:

  • Illustrative, not prescriptive
  • Used in documentation examples
  • Not a requirement for DIDP adoption

Guidance

Do

  • Keep DIDP phases independent of specific tools
  • Document your project’s build system in iteration_state.yaml
  • Use phase artifacts to capture build requirements

Don’t

  • Bind DIDP concepts to specific build tool features
  • Assume all projects use the same toolchain
  • Require specific CI/CD platforms

Examples

TypeScript/Bun Project

# iteration_state.yaml
build_system:
  type: bun
  commands:
    build: bun run build
    test: bun test
    lint: bun run lint

Swift/Xcode Project

# iteration_state.yaml
build_system:
  type: xcode
  commands:
    build: xcodebuild -scheme MyApp
    test: xcodebuild test -scheme MyApp
    lint: swiftlint

Fish Shell Scripts

# iteration_state.yaml
build_system:
  type: fish
  commands:
    build: ./build.fish
    test: ./test.fish
    lint: fish --no-execute *.fish

Summary

DIDP stays tool-agnostic by defining abstract operations rather than concrete commands. Projects implement these operations using their preferred toolchain, documented in project configuration.