Information Hiding Review

VerifiedSafe

Checks for information leakage across module boundaries. Detects temporal decomposition and false encapsulation.

Sby Skills Guide Bot
DevelopmentIntermediate
7/23/2026
Claude CodeCursor
#information-hiding#architecture#encapsulation#code-review#modularity

Recommended for

Automated summary

A review lens that checks whether modules genuinely encapsulate their design decisions, detecting information leakage across boundaries and temporal decomposition.

Strengths

  • Clearly separates interface leakage from back-door leakage, the latter being invisible in the code surface
  • Provides concrete, reusable tests (knowledge ownership test, temporal decomposition trap)
  • Dispels the illusion of encapsulation created by private fields with getters and setters
  • Acknowledges that partial hiding has value and that making a dependency obvious can be enough

Limitations

  • Read-only analysis: it flags problems but does not produce automated refactorings
  • Relies heavily on human judgement to spot which design decisions are actually shared
  • Can feel redundant with SRP or cohesion principles the team already knows
When to use it

Use it during module boundary reviews, when several files change together for a single decision, or when a format or protocol shows up in multiple places.

When not to use it

Avoid it on throwaway code or tiny scripts where separating knowledge ownership yields no measurable benefit.

Security analysis

Safe
Quality score86/100

This is a read-only code-review guidance document. The declared tools are Read and Grep, and the content is purely conceptual advice about information hiding, module boundaries, and leakage detection. There are no bash commands, network calls, credential handling, file mutations, or instructions to disable safety controls. The only minor operational note is that it references an on-demand file (references/back-door-leakage.md) that is not bundled here, but reading a relative reference file carries no meaningful risk.

No concerns found

How this analysis is made

Examples

Review a module boundary
Run an information-hiding review on src/parser/ and tell me which design decisions leak across the module boundaries.
Diagnose lockstep changes
These three files always change together for the same feature — apply the information-hiding lens and tell me whether this is temporal decomposition or a real shared dependency.
Check false encapsulation
Review src/models/order.py for false encapsulation: private fields with matching getters and setters, and any format knowledge duplicated elsewhere.

name: information-hiding description: Checks for information leakage across module boundaries. Use when the user asks to check information hiding, when modules seem to change together, when implementation details leak across boundaries, or when structure follows execution order rather than knowledge ownership. Detects temporal decomposition and false encapsulation. argument-hint: "[file or module path]" metadata: allowed-tools: Read, Grep

Information Hiding Review Lens

When invoked with $ARGUMENTS, focus the analysis on the specified file or module. Read the target code first, then apply the checks below.

Evaluate whether modules encapsulate design decisions effectively.

When to Apply

  • Reviewing module boundaries or class decomposition decisions
  • When multiple modules change together for single-decision changes
  • When private fields have matching getters and setters
  • When modules are organized around execution steps (read/process/write)
  • When a format, protocol, or representation appears in multiple places

Core Principles

Knowledge Ownership Test

For every design decision in the code (data format, algorithm choice, protocol, storage representation):

  1. Which module owns this decision?
  2. Is that ownership exclusive, and no other module knows this?
  3. If this decision changes, does only one module need editing?

If #3 is "no," there is information leakage.

Two Kinds of Leakage

Interface Leakage

The decision appears in parameters, return types, or exceptions. Bad, but at least visible and discoverable.

Back-Door Leakage

Two or more modules encode the decision in their implementations with nothing in the code surface making the dependency visible. This maps directly to unknown unknowns: a developer modifying one module has no signal the other must change. More pernicious than interface leakage for exactly this reason.

Signs of back-door leakage:

  • Changing an internal data structure breaks a seemingly unrelated module
  • Two modules must be updated in lockstep but have no direct API dependency
  • Shared assumptions about file formats, message ordering, or naming conventions that exist only in developers' heads
  • Tests that break in module B when module A's internals change

Not all dependencies are eliminable. Transforming a hidden dependency into an obvious one is often more valuable than trying to remove it. At least then the next developer knows to look.

The Temporal Decomposition Trap

The most common cause of information leakage is temporal decomposition. When code gets split into a "read the file" step and a "parse the file" step, both modules have to agree on the file format. It's important to draw boundaries around knowledge domains, not execution phases. A module that reads AND writes a format should own the definition of that format exclusively. Merging the two steps actually produces one module with a simpler interface and no shared assumptions. A slightly larger class that hides (i.e. abstracts) more is almost always worth the extra length.

This fails at larger scales too. Microservices split along workflow stages scatter shared protocol knowledge across service boundaries.

Private Is Not Hiding

Marking a field private and providing getters/setters does not actually hide it. Other code still knows the field exists, what it's called, and what type it holds. That is as much exposure as if the field were public.

Test: Does the caller need this information to use the module correctly? If no, it should be genuinely invisible, not just access-controlled.

Partial Hiding Has Value

Information hiding is not all-or-nothing. If a feature is only needed by a few users and accessed through separate methods not visible in common use cases, it is mostly hidden, creating fewer dependencies than information visible to every user. Design for the common case to be simple. Rare cases can require extra methods.

Hiding Within a Class

Information hiding applies inside a class too, not just at its boundary. Design private methods so each encapsulates some capability hidden from the rest of the class. Minimize the number of places where each instance variable is used. Fewer internal access points means fewer internal dependencies.

Don't Hide What Callers Need

Information hiding only makes sense when the hidden information isn't needed outside the module. If callers genuinely need something (performance-tuning parameters, configuration that varies by use case), it must be exposed. The goal is to minimize the amount of information needed outside, not to hide everything unconditionally.

Leakage Through Over-Specialization

When a general-purpose module is given knowledge of specific higher-level operations, information leaks upward. When a general-purpose data layer defines methods like archiveExpiredItems, it encodes business-rule knowledge. Any change to the expiration policy forces a data-layer change. This is the special-general mixture red flag.

Review Process

  1. Inventory design decisions: List formats, algorithms, protocols, data structures, representation choices
  2. Map ownership: For each, identify which module(s) know about it
  3. Flag leakage: Any decision known by more than one module is leaking
  4. Check for temporal decomposition: Are boundaries drawn around steps or knowledge?
  5. Audit getters/setters: Are any "private" fields effectively public through accessors?
  6. Propose consolidation: Merge the knowing modules, or extract shared knowledge into a single owner with a genuinely abstract interface

Red flag signals for information hiding are cataloged in red-flags (Information Leakage, Temporal Decomposition, Overexposure).

References

For deeper coverage, load these on demand:

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/information-hiding-review-mrx3xxhe/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/information-hiding-review-mrx3xxhe' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/information-hiding-review-mrx3xxhe/download' --output '.skill-downloads/information-hiding-review-mrx3xxhe/SKILL.md.part' && mv '.skill-downloads/information-hiding-review-mrx3xxhe/SKILL.md.part' '.skill-downloads/information-hiding-review-mrx3xxhe/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/information-hiding-review-mrx3xxhe/SKILL.md' && test -s '.skill-downloads/information-hiding-review-mrx3xxhe/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/information-hiding' && cp -R '.skill-downloads/information-hiding-review-mrx3xxhe' '.claude/skills/information-hiding'

Cursor
test -f '.skill-downloads/information-hiding-review-mrx3xxhe/SKILL.md' && test -s '.skill-downloads/information-hiding-review-mrx3xxhe/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/information-hiding' && cp -R '.skill-downloads/information-hiding-review-mrx3xxhe' '.cursor/skills/information-hiding'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/information-hiding-review-mrx3xxhe'

openskills read 'information-hiding-review-mrx3xxhe'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/information-hiding-review-mrx3xxhe/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills