Spec: Backend Domain Structure Guardrails
Spec: Backend Domain Structure Guardrails
User Input
User request:
run delivery-phase on https://github.com/wearedevpunks/harness-intelligence/issues/67 full parallel no autoreview step.
once done update changelog and push baseline
Issue 67 summary:
Enhance the shared backend-domain-structure skill with generic Python backend layer guidance discovered during pre-existing skill reconciliation. Do not add project-specific paths or repository names. The useful reusable deltas are: layer classifier, import direction, DI boundaries, public API rules, and validation prompts.
Context
The shared backend-domain-structure skill teaches agents how to place backend code by responsibility. Issue 67 tightens that skill for generic Python backend architecture work, where agents need clearer layer classification and boundary checks before moving files or adding backend modules.
The result is for agents and implementation workers using the shared skill across repos. It must remain generic and portable, while giving enough guardrails to prevent transport-heavy handlers, framework leakage into domain code, persistence leaks, dependency cycles, and accidental public APIs.
Non-Goals
- Add project-specific backend paths, package names, app names, or Harness-only examples.
- Refactor any backend application code.
- Change framework-specific skills except where they need to keep referencing this shared skill correctly.
- Add an autoreview phase or review task.
Acceptance Criteria
backend-domain-structureincludes an explicit responsibility classifier for transport/app composition, feature/product domains, platform/framework concerns, infrastructure/integrations, database persistence, and pure domain models/events.- The skill defines dependency direction from transport/composition toward features and infrastructure, and rejects lower-layer imports back into route/app composition.
- The skill states DI/container boundaries: composition roots wire containers, business logic receives protocols/interfaces/adapters, and domain code does not perform container lookups.
- The skill defines public boundary rules for feature/package roots, named contracts/types, private internals, cross-feature calls, and stale compatibility aliases.
- The skill keeps database persistence behind repositories or persistence adapters.
- The skill includes validation prompts for import-boundary checks, focused compile/type/test checks, stale-symbol search, and manual dependency-direction inspection.
- The final wording remains generic to Python and backend architectures generally, without Harness-specific paths or product names.
- Harness distribution surfaces are refreshed from shared skill source through the established sync path, with evidence recorded.
Constraints
- Shared skill source must be edited in
/Users/stefan/Desktop/repos/wearedevpunks-skillsfirst, then synced into Harness. apps/cli/skills/*and.agents/skills/*are downstream mirrors, not source-of-truth authoring surfaces.- Implementation must preserve unrelated dirty work in both repositories.
- No app code changes belong to this issue.
Technical Notes
- Current shared source at
/Users/stefan/Desktop/repos/wearedevpunks-skills/skills/agnostic/backend/backend-domain-structurealready has uncommitted edits that appear to cover most issue 67 guardrails. - Current Harness mirrors under
apps/cli/skills/agnostic/backend/backend-domain-structureand.agents/skills/backend-domain-structurestill show the older, shorter wording. bun run sync:skillsrefreshes the CLI-vendored bundle from the shared skills source after the source is published; active.agents/skills/*mirrors may need explicit alignment depending on the implementation goal.
Decision Log
| Decision | Rationale |
|---|---|
| Keep the skill generic | Issue 67 explicitly rejects project-specific paths and names. |
| Treat shared skill source as authoritative | Harness guidance says downstream skill copies are generated mirrors. |
| Plan sync and mirror validation as part of delivery | The change is only useful when the distributed and active Harness surfaces can consume it. |
| Treat the spec as reviewed for this delivery run | The user requested full delivery, and the GitHub issue body is bounded with no unresolved requirements. |
| Skip autoreview | User explicitly requested no autoreview step. |