agentleFS
hmj1026hmj1026/dhpk/skills/module-design/SKILL.md

module-design

Skill2 starsChanged 6 days agoMITView on GitHub

Design or compare module responsibilities, public interfaces, and architecture trade-offs. Use when a boundary or adapter choice is unresolved. Supports design, review, compare, and bounded adversarial modes. Not for implementing a confirmed design, tracing code, or reviewing code correctness. Output: a bounded recommendation with evidence and verification needs.

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep this guidance stack-neutral until the repository evidence selects a framework or language.

    line 14
  2. Distinctive:

    Start with the user's named module, subsystem, or pain point.

    line 19
  3. Distinctive:

    Keep one hypothetical adapter inline.

    line 59
  4. Distinctive:

    ambiguous-term: before it reaches an interface or event name.

    line 74
  5. Distinctive:

    Write edge-case scenarios for empty, duplicate, partial, stale, and failed inputs as applicable.

    line 75
  6. Distinctive:

    Prefer domain-specific names and focused files.

    line 77

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Module design

Design the smallest deep module that makes the caller's next decision easy. Keep this guidance stack-neutral until the repository evidence selects a framework or language.

Scope before scan

Start with the user's named module, subsystem, or pain point. When no direction is named, use recent commit history to find the hot spots that keep changing and weight the exploration there. Do not propose deepening across the whole codebase before a real seam, caller, and near-term change are identified; this is the YAGNI filter for architecture work.

Modes

Select exactly one mode from design, review, compare, or adversarial; design is the default. In every mode, frame the question, constraints, scope, risks, and decision criteria before recommending a seam.

  • Design proposes a boundary for a new capability or change.
  • Review evaluates an existing boundary against callers, data flow, and failure modes.
  • Compare scores concrete alternatives against the named criteria rather than treating personal preference as evidence.
  • Adversarial forms an independent Proposal A and, only when explicitly requested, a blind Proposal B; run three bounded critique rounds by default and never more than five. Preserve material disagreement and stop with unresolved disagreement when the evidence does not support convergence.

Optional second opinion

The primary path uses only the current in-process model and does not invoke a second opinion. An explicit --second-opinion=codex-exec opt-in may run codex exec as a blind, clearly labelled additional proposal or critique; it must never replace the primary recommendation or become a silent fallback. Record the question, constraints, research summary, assumptions, decision criteria, failure modes, and any changed recommendation for that opinion.

Boundary tests — SSOT: architecture/tests own runtime behavior; this skill owns boundary decisions

  • Caller leverage: define the decision the caller should make and make the module absorb the policy and variation behind that decision.
  • Deletion test: temporarily imagine deleting the proposed abstraction. If callers become simpler or no behavior is lost, delete it; a name alone is not a module boundary.
  • Interface-as-test-surface: make the public interface the behavior seam; tests should assert caller-visible outcomes through it, not private helpers.
  • Keep one hypothetical adapter inline. Introduce an abstraction only when there are two real adapters, or when a documented near-term boundary has a concrete test or deployment need. Do not design for speculative providers.
  • Make the change easy before making the easy change: prefer a small prefactor that improves locality only when the next requested behavior needs it, and record speculative candidates as deferred rather than building them.

For dependencies that cross an I/O or ownership boundary, load Dependency and test choices before recommending adapters or substitutes. Record what is actually available; the table guides a decision rather than mandating a new abstraction.

Language and scenarios

  • Maintain an active glossary for domain terms; challenge an ambiguous-term before it reaches an interface or event name.
  • Write edge-case scenarios for empty, duplicate, partial, stale, and failed inputs as applicable. A happy path is not a boundary contract.
  • Prefer domain-specific names and focused files. Avoid generic buckets that hide ownership or make deletion difficult.

Decisions and output

Recommend a boundary, interface, data flow, and trade-offs. For an I/O boundary, include the dependency owner, available test substitute, and verification gap. Record an ADR only when the decision is surprising, hard-to-reverse, or likely to be revisited; routine local choices belong in the implementation plan or tests.

For adversarial work, report the question and criteria, each independent proposal, every bounded critique round, evidence versus inference, convergence status, final recommendation, residual risks, and the smallest follow-up experiment or decision. Never claim independent verification unless the named second opinion actually ran.

When NOT to Use

  • Tracing an existing execution path without a boundary decision (use code-trace).
  • Implementing an already-confirmed design (use flow-guide or the matching OpenSpec apply route).
  • Reviewing code or security controls (use change-verdict).

Verification

  • Caller leverage and the deletion test justify the boundary.
  • The interface is an observable test surface with independent expected values.
  • Adapter count and abstraction threshold are explicit.
  • Glossary ambiguities and edge-case scenarios are named.
  • ADR use is limited to surprising or hard-to-reverse decisions.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.