read-before-edit

Read target files and related modules before code modifications.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/cityfish91159/maihouses --skill read-before-edit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: read-before-edit
Source: https://github.com/cityfish91159/maihouses/tree/main/.claude/skills/read-before-edit
Command: npx skills add https://github.com/cityfish91159/maihouses --skill read-before-edit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces a disciplined workflow requiring researchers and developers to read surrounding code and related modules before editing, reducing the risk of introducing regressions.

Core Features & Use Cases

  • Reading Guidance: Identify and read related files, types, APIs, hooks, and context before edits.
  • Safe Editing: Minimizes risk by ensuring changes are well-informed.
  • Use Case: Before implementing a bug fix, read all related modules to understand dependencies.

Quick Start

Before editing, read the target file and its related modules as outlined.

Frequently Asked Questions about read-before-edit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent introducing bugs when editing code?

Read the target file and all related modules—imports, types, APIs, hooks, context, and utilities—before making edits. This read-before-edit discipline ensures changes are informed by the full dependency graph, reducing regression risk and catching unintended side effects early.

What files should I review before editing a component or function?

Review the target file itself, its direct imports, type definitions, API or service calls it depends on, custom hooks, context providers, related components, and shared utility functions. Structured reading of this scope ensures you understand how changes propagate through the codebase.

How do I audit that code changes were well-informed and safe?

Document your reading steps using Read, Grep, and Glob tools to create auditable traces. This workflow captures which files you reviewed, what you found, and how that informed your edits, providing traceability for code review and regression prevention.

When should I apply read-before-edit discipline?

Apply this discipline whenever you modify code—bug fixes, feature additions, or refactors. The requirement is mandatory across all modification scenarios to enforce consistent safety and comprehension before any Edit or Write operation.

Can read-before-edit discipline work across a large project?

Yes. This discipline scales across projects by systematizing how you identify related files through imports, type definitions, and API dependencies. Structured verification and auditable traces using file tools keep the process tractable at any codebase size.

What's the difference between reading and editing, and why does order matter?

Reading first means comprehending scope, dependencies, and side effects before any code change. Order matters because edits made without this context risk breaking untested code paths, violating type contracts, or breaking dependent modules—regressions that reading prevents.