# Enforce package boundaries inside a Rails monolith before coupling spreads with Packwerk

> Check a Rails codebase for dependency and visibility violations so domain boundaries stay reviewable instead of dissolving over time.

- Skill: `agentskillexchange/enforce-package-boundaries-inside-a-rails-monolith-before-co` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/enforce-package-boundaries-inside-a-rails-monolith-before-co`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/enforce-package-boundaries-inside-a-rails-monolith-before-co/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/enforce-package-boundaries-inside-a-rails-monolith-before-co

---


# Enforce package boundaries inside a Rails monolith before coupling spreads with Packwerk

Check a Rails codebase for dependency and visibility violations so domain boundaries stay reviewable instead of dissolving over time.

## Prerequisites

Ruby, Bundler, a Rails application with Zeitwerk enabled, Packwerk gem installation, and repository access to the monolith being analyzed

## Installation

Use the upstream install or setup path that matches your environment:
- gem 'packwerk'
- $ gem install packwerk

Requirements and caveats from upstream:
- This is because we rely on [Zeitwerk's conventions](https://github.com/fxn/zeitwerk#file-structure), and code that is loaded differently (like through an explicit require) often doesn't follow these conventions.

Basic usage or getting-started notes:
- Packwerk needs [Zeitwerk](https://github.com/fxn/zeitwerk) enabled, which comes with Rails 6.
- Packwerk supports MRI versions 2.7 and above.
- ## Demo

- Source: https://github.com/Shopify/packwerk
- Extracted from upstream docs: https://raw.githubusercontent.com/Shopify/packwerk/HEAD/README.md

## Documentation

- https://github.com/Shopify/packwerk

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/enforce-package-boundaries-inside-a-rails-monolith-before-coupling-spreads-with-packwerk/)

