directory-structure-enforcement-hooks

Community

Enforce project structure with 3-layer hooks.

Authorshimo4228
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Claude Code drift: prevents files from being created in wrong locations despite CLAUDE.md rules.

Core Features & Use Cases

  • Three-layer defense:
  • PreToolUse hook (docs-prewrite.sh): Write/Edit-time validation, exit 0 to allow, exit 2 to block, stderr to warn. Reads JSON from stdin to inspect tool_input.file_path.
  • Stop hook (driftcheck.sh): session end scan to catch changes by mv or external processes; always exits 0 to avoid blocking the session end.
  • hooks.json matcher exclusion: excludes from generic blockers to avoid conflicts.

Quick Start

Configure and deploy the three-layer hooks to automatically validate file paths during Claude Code changes.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: directory-structure-enforcement-hooks
Download link: https://github.com/shimo4228/claude-code-learned-skills/archive/main.zip#directory-structure-enforcement-hooks

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.