Skip to content
Development
Skill

/backend-scaffolding

Scaffolds Node.js/TypeScript backend components with CMDO architecture, driven by component settings.

From plugin
sdd
4359 skills7 agents3 commands

Claude Code

$ npx -y skills add LiorCohen/sdd --skill backend-scaffolding --agent claude-code

SKILL.md

backend-scaffolding.SKILL.md
name: backend-scaffolding
description: Scaffolds Node.js/TypeScript backend components with CMDO architecture, driven by component settings.
user-invocable: false

Backend Scaffolding Skill

Creates a Node.js/TypeScript backend component following the CMDO (Config, Model, DAL, Operator) architecture. Scaffolding is driven by **component settings** defined in `sdd/sdd-settings.yaml`. Delegate to the `techpack-settings` skill for the authoritative server settings schema — it accepts a component type (`server`) and returns the typed settings object including `server_type`, `databases`, `provides_contracts`, and framework defaults.

When to Use

Use when creating server components. Supports multiple named instances (e.g., `main-server`, `background-worker`).

Settings-Driven Scaffolding

Server components are scaffolded based on their settings in `sdd/sdd-settings.yaml`. Delegate to the `techpack-settings` skill for the complete server settings schema and defaults — it returns `server_type` (express/fastify/nestjs), `databases` (array of referenced database component names), `provides_contracts` (array of contract component names), and framework-specific configuration.

Conditional Scaffolding Logic

// Pseudocode for settings-driven scaffolding
const scaffoldServer = async (component: ServerComponent): Promise<void> => {
  // Always scaffold: core structure, operator lifecycle, model layer
  await scaffoldCore(component);

  // Conditional: HTTP routes (only if server provides contracts)
  if (component.settings.provides_contracts.length > 0) {
    await scaffoldRoutes(component, component.settings.provides_contracts);
  }

  // Conditional: API clients (only if server consumes contracts)
  if (component.settings.consumes_contracts.length > 0) {
    await scaffoldApiClients(component, component.settings.consumes_contracts);
  }

  // Conditional: DAL layer per database
  for (const db of component.settings.databases) {
    await scaffoldDAL(component, db);
  }
};

What It Creates

Base Structure (Always Created)

components/servers/<name>/
├── package.json
├── tsconfig.json
├── .gitignore
└── src/
    ├── index.ts                    # Entry point
    ├── config/
    │   ├── index.ts
    │   └── load_config.ts          # Config loading
    ├── operator/
    │   ├── index.ts
    │   ├── create_operator.ts      # Operator factory
    │   ├── lifecycle_probes.ts     # Health/ready endpoints (port 9090)
    │   ├── logger.ts               # Structured logging
    │   ├── metrics.ts              # Metrics collection
    │   └── state_machine.ts        # Lifecycle state machine
    ├── controller/
    │   ├── index.ts
    │   └── create_controller.ts    # Controller factory
    └── model/
        ├── index.ts
        ├── dependencies.ts         # Dependency injection interface
        ├── definitions/
        │   └── index.ts            # Empty barrel
        └── use-cases/
            └── index.ts            # Empty barrel

Conditional: HTTP Server (when `server_type` includes `api`)

└── src/
    └── operator/
        └── create_http_server.ts   # HTTP server setup (port 3000)

Conditional: HTTP Handlers (when `provides_contracts` is non-empty)

└── src/
    └── controller/
        └── http_handlers/
            └── index.ts            # Route handlers for contracts

Conditional: DAL Layer (when `databases` is non-empty)

For each database in `databases`, creates:

└── src/
    └── dal/
        └── <database-name>/
            └── index.ts            # DAL functions for this database
    └── operator/
        └── create_database_<name>.ts  # Database connection setup

Conditional: API Clients (when `consumes_contracts` is non-empty)

For each contract in `consumes_contracts`, generates API client from contract spec.

CMDO Architecture

| Layer | Purpose | Location | |-------|---------|----------| | **C**onfig | Configuration loading and validation | `src/config/` | | **M**odel | Business logic, definitions, use cases | `src/model/` | | **D**AL | Data Access Layer, database operations | `src/dal/` | | **O**perator | Application lifecycle, servers, telemetry | `src/operator/` |

Plus **Controller** for HTTP request handling.

Directory Structure

Servers live at `components/servers/<name>/`:

| Component Name | Directory | |----------------|-----------| | `main-server` | `components/servers/main-server/` | | `background-worker` | `components/servers/background-worker/` |

Template Variables

| Variable | Description | |----------|-------------| | `{{PROJECT_NAME}}` | Project name | | `{{PROJECT_DESCRIPTION}}` | Project description | | `{{PRIMARY_DOMAIN}}` | Primary business domain | | `{{SERVER_NAME}}` | Server component name |

Templates Location

All templates are colocated in this skill's `templates/` directory:

skills/components/backend/backend-scaffolding/templates/
├── package.json
├── tsconfig.json
├── .gitignore
└── src/
    ├── index.ts
    ├── config/
    ├── operator/
    ├── controller/
    ├── model/
    └── dal/

Config Integration

When scaffolding a server component, the config section is generated based on settings.

Example: API Server with Database

Settings:

- name: main-server
  type: server
  settings:
    server_type: api
    databases: [primary-db]
    provides_contracts: [public-api]

Generated config (`components/config/envs/default/config.yaml`):

main-server:
  port: 3000
  probesPort: 9090
  logLevel: info
  databases:
    primary-db:
      host: localhost
      port: 5432
      name: myapp
      ssl: false

Example: Worker without Database

Settings:

- name: background-worker
  type: server
  settings:
    server_type: worker
    databases: []
    provides_contracts: []
    consumes_contracts: [public-api]

Generated config:

background-worker:
  probesPort: 9090
  logLevel: info
  qu
Read more
@liorcohen
Ships withsdd

Structure for AI-assisted development AI coding assistants are powerful but chaotic. You prompt, you get code, but then what?

4359 skills7 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
43
Star history of LiorCohen/sdd on GitHub, a chart by star-history.com

Other skills on sdd.

agents-standards

agents-standards

Standards for authoring SDD plugin agents — frontmatter, self-containment, skill references, and no-user-interaction rules.

@liorcohen@liorcohenInstall Skill
commands-standards

commands-standards

Standards for authoring SDD plugin commands — frontmatter, user interaction, skill/agent invocation, CLI integration, and output…

@liorcohen@liorcohenInstall Skill
commit

commit

Create a commit following repository guidelines with proper versioning and changelog updates.

@liorcohen@liorcohenInstall Skill
critic

critic

Two-step self-review at every task lifecycle phase. Step 1 (this skill) runs in-context to gather session signals — files read vs…

@liorcohen@liorcohenInstall Skill
d2

d2

D2 diagramming language reference for architecture diagrams, sequence diagrams, grid layouts, SQL tables, and class diagrams.…

@liorcohen@liorcohenInstall Skill
docs-standards

docs-standards

Writes and maintains user-facing documentation for the SDD plugin. Proactively detects when docs are out of sync with plugin…

@liorcohen@liorcohenInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills13d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react4d252k
@facebook@facebookInstall Skill

Questions about backend-scaffolding.

Which coding agents can use backend-scaffolding?
backend-scaffolding installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.