victorzhuk/skills

z-deep-modules

Deep-module design vocabulary — depth as leverage at the interface, seams, adapters, the deletion test, interface-is-the-test-surface.

查看源码

使用方法

  1. 复制安装命令,在自己的智能体环境安装前先检查源码包。
  2. 从原始文档核对所需工具、凭据和支持的宿主。
  3. 说明输入材料与期望交付物,并对照来源检查输出。
npx skills add https://github.com/victorzhuk/skills --skill z-deep-modules

开始前需了解

  • 安装不包含模型订阅、API 额度或访问文件的权限。
  • 仓库星数和安装量反映活跃情况,不等于独立质量或安全测试。
仓库原始内容

按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。

Deep modules

Hide useful behavior behind a small interface. Apply this as a design lens while preserving the project's vocabulary and established architecture.

Terms

  • Module: an interface and its implementation, from a function to a larger subsystem.
  • Interface: what callers must know, including types, invariants, ordering, errors, configuration, and performance.
  • Depth: useful behavior hidden relative to the interface a caller must learn.
  • Seam: a point where behavior can be substituted without editing callers.
  • Adapter: an implementation that translates or supplies behavior at a seam.
  • Locality: how closely a change, its consequences, and its verification stay together.

Use the project's terms such as service, component, API, or boundary when they carry the intended meaning. Do not rename concepts merely to adopt this glossary.

Evaluate the interface

  • Ask whether fewer methods or simpler parameters can express the contract.
  • Move internal coordination behind the interface when callers should not own it.
  • Include errors, side effects, and required sequencing when judging interface complexity.
  • Use the deletion test: if removing the module duplicates its hidden logic across callers, it earns its place.
  • Do not use implementation line count as a depth score.

Information hiding does not require multiple implementations. A single implementation may justify a package or module through ownership, invariants, or reuse.

A polymorphic seam needs a concrete reason: runtime variation, an external dependency, a required test substitute, or an established architectural boundary. Do not invent a second adapter solely to justify an interface.

Test the behavior

Use the lowest public interface that proves the contract without hiding integration risk. Internal tests can serve invariants that are not externally distinguishable; avoid coupling assertions to incidental call order or private layout.

Substitute dependencies only where the test needs control. Do not mock the module under test.

Do not

  • Declare every single-implementation module premature.
  • Keep a pass-through layer without an ownership or contract reason.
  • Force every test through one system-wide interface.
  • Rewrite established project terminology to match this skill.

Verify

Each new boundary has a current reason, callers need fewer implementation facts, and tests survive internal refactors while detecting behavioral regressions.

See [[z-domain-modeling]], [[z-no-over-engineering]], [[z-go-interfaces]], [[z-tdd]].

来自同一仓库

更多 Skills

全部 Skills
victorzhuk
社区

z-accessibility

Audit and improve web accessibility following WCAG 2.2 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible".

安装量
1
GitHub Stars
0
最近更新
10月22日
victorzhuk
社区

z-algo-core

DS/algorithm selection judgment for production code, not competitive tricks — hash map for membership/dedup, slice+sort beats a tree until proven, heap for top-k, two-pointer/sliding-window for scans, BFS/DFS/topo-sort for dependency shapes. Triggers on Big-O, hash map vs tree. Does not cover profiling/tuning; see [[z-go-performance]].

安装量
1
GitHub Stars
0
最近更新
10月22日
victorzhuk
社区

z-bdd

BDD acceptance contracts for humans and agents across UI, API, and CLI products. Use for Gherkin, Given-When-Then, E2E acceptance, or scenario evidence. Define repeatable scenarios with explicit assertions and required outcomes. Test selection belongs to [[z-testing-strategy]]. Go harness wiring belongs to [[z-go-bdd]].

安装量
1
GitHub Stars
0
最近更新
10月22日
victorzhuk
社区

z-codegraph

Use an existing CodeGraph integration for call graphs, impact analysis, affected tests, or route discovery. Discover installed tools and index freshness; follow host LSP precedence and verify current source. Do not initialize indexes without user authorization.

安装量
1
GitHub Stars
0
最近更新
10月22日