Repository structure and rules
Understand how application ownership, explicit boundaries, and proportionate verification keep changes small and safe.
A repository's instructions, architecture, conventions, dependencies, and lockfiles determine how work fits into that project. The recommended stack is an optional technology choice; the principles here apply to other stacks too. They do not require agent skills or impose a new directory layout.
These principles help determine where a change belongs, which behavior it must preserve, and what evidence is enough to trust it. The canonical rules live in implementation patterns, deployment and operations, and verification guidance. Implementing skills bundle the applicable references; readers do not need to install another workflow to use them.
Code belongs to the application that owns it
Application code starts in its deployable unit. Business logic, data access, authentication, UI, and vendor integrations stay with the application that needs them, using its native module and manifest conventions. A root workspace coordinates genuinely shared tasks; it does not own every app's implementation.
Shared packages become useful when multiple applications need the same implementation or contract. For example, a web app and a mobile app may share validation and API types while retaining different routers and controls. Extracting the shared contract removes a real duplicate. Creating empty packages for hypothetical reuse adds a boundary without removing work.
Different technologies do not need matching folder structures. Each application can keep its native layout while sharing a technology-neutral contract where a boundary requires one.
Boundaries isolate outside formats
HTTP requests, RPC calls, webhooks, and vendor APIs carry data in formats that may differ from the application's own models. Boundary adapters validate input, translate representations, and map errors so domain logic does not depend on transport or vendor details. An adapter can be a function or module; a class is not required.
For example, a vendor response may need to become an application-owned billing result before business logic uses it. If a deliberately shared API contract already is the application's model, validation and error handling still matter, but a pass-through mapping layer adds no useful isolation.
This rule applies to new or materially changed boundary flows. It is not a reason to migrate untouched integrations during an unrelated task. The boundary contract defines the scope, including its exclusion of ordinary in-process calls and database persistence mapping.
Types and validation protect different boundaries
Static types help catch mistakes within code that participates in type checking. Runtime validation checks untrusted values before internal code consumes them. A typed API client does not make a request trustworthy at the server.
Related contract types should derive from one source where the selected technology supports it. Type helpers remain with their owner until several applications need the same definition. Narrow, documented exceptions are different from bypassing checks to make a build pass.
Compatibility is a commitment, not an assumption
The repository's compatibility policy and support window determine which contracts must remain
stable. Existing code alone does not prove a support commitment, but a 0.x version or unreleased
label does not waive one either. Unclear obligations need a decision before a breaking change or
new compatibility machinery.
For supported contracts, route identifiers, existing fields, and error meanings remain stable; optional inputs, additional output fields, and distinct error codes allow compatible extension. An approved break follows the project's migration or versioning policy.
Where compatibility is explicitly unnecessary, callers, tests, and documentation can change together, and replaced paths can be removed without aliases for hypothetical consumers. Data preservation is separate: permission to break an API does not authorize discarding stored data. The compatibility rules keep these decisions distinct.
Dependency ownership makes builds reproducible
Each application declares its runtime dependencies. Shared packages declare their own dependencies; root tooling belongs there only when it is repository-wide. Package boundaries then reflect what actually runs, without relying on another app's accidental installation.
Selected or changed versions come from authoritative current sources, with runtime and peer compatibility checked at the consumer. Existing versions and lockfiles stay unchanged when no dependency change is needed. A recommendation page or a model's memory is not a dependency-resolution record. Lockfiles and integrity metadata preserve the package manager's actual resolution.
Small changes still preserve safety
Less code is easier to inspect and maintain when it still meets the requirement. Removal, in-tree reuse, standard facilities, platform features, and installed dependencies are preferable to another helper when they already solve the problem.
Validation, error handling, security, accessibility, and data-loss protections set the lower bound. Two checks at different trust boundaries may look repetitive while protecting against different failures. Removing one merely to reduce duplication can weaken the system. See Least code, still safe for the reasoning behind this tradeoff.
Verification follows the changed behavior
Existing adequate protection is a valid starting point. Additional tests are useful when they cover a new behavior, a regression, or a material risk, rather than repeat equivalent assertions. Required repository checks remain required; service slowness is not evidence that they passed.
A focused test can prove a function's behavior without proving the deployed application's integration. Likewise, a successful build cannot prove that a model followed an instruction. Evidence is strongest when the claim matches what the check actually observed. The verification explanation covers these boundaries; the verification guide helps select practical checks.
Production state needs explicit ownership
Schema migrations change persistent state independently of application releases. Ordered, version-controlled migrations run through controlled automation with observable failure and recovery. Compatibility with the currently deployed app matters because a code rollback does not undo schema or data changes.
Production secrets belong in the host secret store. A repository can describe required key names without containing their values. Server-side session checks and explicit authorization protect private data; client-side routing and indexing controls do not.
Structured telemetry helps explain failures only when credentials and personal data are redacted before transmission. Connection limits, retries, backups, and restoration also belong to the project's operating design, not implicit framework defaults. See the operations reference for the full requirements.
Applying these principles with Woostack
Execute handles an authorized bounded implementation, including the first slice of a new project. Initial creation checks the target before writing; it does not authorize overwriting existing content. Init separately owns project guidance. Whiteboard develops a plan when one is requested.
Once Git exists, workspace guidance governs isolation and ownership. Implementing workflows perform requested Git and PR delivery through the shared delivery procedure. An ordinary implementation request authorizes local edits and checks, not an automatic push or PR. New PRs are drafts; merging remains a human decision. The workflow explanation describes these authority limits.