Back

Principle Boundary Discipline

Databases & backend8.1K installs

What it does

Apply when wiring validation, error handling, or framework adapters. Concentrate guards at system boundaries (CLI, config, network, external APIs); trust internal types and keep business logic in pure functions.

Install

npx skills add https://github.com/backnotprop/pstack --skill principle-boundary-discipline

Website

www.skills.sh/backnotprop/pstack/principle-boundary-discipline

Details

From the skill’s SKILL.md or README, by its authors. View the original

Boundary Discipline

Place validation, type narrowing, and error handling at system boundaries. Trust internal code unconditionally. Business logic lives in pure functions. The shell is thin and mechanical.

Why: Scattered validation is noisy, redundant, and gives a false sense of safety. Keep logic out of framework wiring so it can be tested without the framework.

The pattern:

  • At boundaries (CLI args, config files, external APIs, network protocols): validate, return errors, handle defensively.
  • Inside the system: typed data, error propagation, no re-validation. Trust the types.
  • Across the boundary. Expose domain concepts, not the boundary's private representation. Keep general-purpose mechanism inside and special-purpose policy at the edge.

Applications:

Validation and error handling:

  • Validate config at parse time (the boundary), not inside business logic
  • Parse raw data into domain types at the boundary
  • Do not re-export transport, storage, framework, or wire types through the public surface
  • No redundant nil checks deep in call chains if the boundary already validated

Code organization:

  • Business logic in pure functions with no framework dependencies
  • Parse functions: pure transforms from raw bytes to typed state
  • Prompt construction: structured state in, string out
  • Scoring and assessment: pure transforms from state to results

The tests:

  • Is this data crossing a system boundary right now? If not, validation is redundant.
  • Can this be a pure function that the shell just calls? If yes, extract it.
See all
  • Databases & backend

    Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID…

    npx skills add https://github.com/microsoft/azure-skills --skill entra-app-registration
    649.5K installs
  • Databases & backend

    Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and…

    npx skills add https://github.com/supabase/agent-skills --skill supabase-postgres-best-practices
    478.7K installs
  • Databases & backend

    Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete",…

    npx skills add https://github.com/prisma/skills --skill prisma-client-api
    418.2K installs
  • Databases & backend

    Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.

    npx skills add https://github.com/prisma/skills --skill prisma-database-setup
    416.4K installs

Skills are shared by members and not reviewed by us. Read a skill’s code before you install it.