# Architectural Drift

> Runbook for checking architectural drift, enforcing <300 line files, and applying Scott Wlaschin DDD principles.

- Skill: `lprior-repo/architectural-drift` (Agent Skill)
- Install (CLI): `npx skillmds@latest add lprior-repo/architectural-drift`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lprior-repo/architectural-drift/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: lprior-repo (https://skillmd.com/u/lprior-repo)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/lprior-repo/architectural-drift

---


# Architectural Drift Protocol

1. **Verify Line Counts**:
   Check all `.rs` files in the current workspace.
   Any file > 300 lines MUST be split. Use your bash tools to count lines if needed.

2. **Enforce DDD (Scott Wlaschin)**:
   - Identify primitive obsession (e.g., `String`, `i32` for IDs). Refactor into NewTypes.
   - Check workflows: Are they explicit state transitions modeled as functions?
   - Verify `Parse, don't validate` is actually adhered to.

3. **Refactor & Split**:
   - If refactoring is needed: Create new files, update `mod.rs` or `lib.rs`/`main.rs`, move code, and ensure it still logically aligns with the contract.

4. **Status Outputs**:
   - State `STATUS: REFACTORED` if edits occurred.
   - State `STATUS: PERFECT` if no edits were needed.
