मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग7.1k · #13510

modular-design-principles

यह क्या करती है

यह स्किल AI को मॉड्यूल संरचना डिज़ाइन और समीक्षा करने के दस सिद्धांत देती है, जैसे साफ़ सार्वजनिक इंटरफ़ेस, स्वतंत्रता और विफलता को सीमित रखना। यह किसी भी तकनीकी स्टैक में अच्छी सीमाएँ चाहने वाले आर्किटेक्ट्स और डेवलपर्स के लिए है।

कब इस्तेमाल करें

  • ✓जब आप डिज़ाइन कर रहे हैं कि सिस्टम को मॉड्यूल या सर्विसेज़ में कैसे बाँटा जाए।
  • ✓जब आप कोडबेस की समीक्षा कर रहे हैं कि कौन सी साझा निर्भरताएँ परेशानी पैदा करती हैं।
  • ✓जब आपको तय करना है कि कोई मॉड्यूल बाँटा जाए या मिलाया जाए।

Skill का लिंक

https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/modular-design-principles/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/modular-design-principles/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“हमारे प्रोजेक्ट का ढाँचा देखिए, बताइए कि मॉड्यूल की सीमाएँ कहाँ कमज़ोर हैं और उन्हें कैसे ठीक करें।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

AI सीमाओं, संयोजनीयता, स्टेट के अलगाव और अनुबंधों को कवर करने वाले कुछ सिद्धांतों का उपयोग करता है और डिज़ाइन को उनके खिलाफ़ जाँचता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Modular Design Principles

Use this skill when reasoning about structure and boundaries in any codebase. It intentionally avoids framework names, folder conventions, and tooling — map principles to your stack locally.

What to load

Task Where
Principles table + violations + workflows (this file) SKILL.md
Per-principle definition, agent rules, abstract examples references/principles.md

Layered mental model

  • Composition roots (applications, hosts, runners): wire modules together; keep orchestration thin.
  • Modules / bounded contexts: cohesive units of behavior and data ownership; each should be understandable and testable on its own.
  • Shared kernels (use sparingly): only stable, truly cross-cutting concepts; resist turning them into a grab-bag of “everything everyone needs.”

How you physically lay this out (mono repo, multi repo, packages, libraries) is a delivery choice, not the definition of modularity. The principles below still apply.


The ten principles

# Principle Intent
1 Well-defined boundaries A small, stable public surface; everything else is internal. Consumers depend on contracts, not internals.
2 Composability Modules can be used alone or combined without special knowledge of each other’s internals.
3 Independence No hidden shared mutable state across boundaries; each module should be testable in isolation (with fakes or test doubles at the edges).
4 Individual scale Resources (compute, storage, rate limits, batch size) can be tuned per module where it matters, without rewriting others.
5 Explicit communication Cross-module interaction uses documented contracts (APIs, events, messages, shared types) — not incidental coupling.
6 Replaceability Dependencies on other modules are expressed through interfaces or protocols so implementations can change.
7 Deployment independence Modules do not assume they share a process, host, or release cadence unless that is an explicit architectural decision.
8 State isolation Each module owns its persistent state and naming; no silent sharing of the same logical data store or ambiguous global names across boundaries.
9 Observability Each module can be diagnosed on its own: logs, metrics, traces, health — attributable to the unit that emitted them.
10 Fail independence Failures are contained (timeouts, bulkheads, circuit breaking, idempotency) so one module’s outage does not blindly cascade.

Principle 8 is often the hardest: ambiguous ownership of data or names is a frequent source of “works until it doesn’t” integration bugs.

For depth (rules for agents + abstract examples per principle), load references/principles.md.


Typical violations (stated abstractly)

  1. Colliding concepts — the same name or schema for different things in different modules, or duplicate “global” definitions that diverge over time.
  2. Reach-through persistence — one module reading or writing another module’s tables, buckets, or documents without going through an agreed contract.
  3. Centralized data ownership — a single persistence layer that registers and exposes all stores for all modules, encouraging hidden coupling.
  4. Logic at the edge — business rules in transport adapters (HTTP handlers, UI, CLI) instead of domain/application code.
  5. Edge talking to storage directly — adapters depending on low-level persistence APIs instead of use cases or application services.
  6. Unscoped transactions — writes that span boundaries without clear transaction ownership and failure semantics.
  7. Leaky exports — repositories, internal services, or implementation types exposed as the module’s public API.
  8. Facades that aren’t thin — “public” entry points that embed querying, mapping, or policy instead of delegating to the right layer inside the module.

Creating a bounded context (workflow)

Use when introducing a new cohesive area of the system (greenfield module or extracted domain).

  1. Scope and language — Name the context; list core nouns/verbs (ubiquitous language). Reject vague names that collide with other contexts.
  2. Responsibilities — What decisions happen only here? What is explicitly out of scope?
  3. State ownership — Which facts are **authori
अक्सर पूछे जाने वाले सवाल

क्या यह किसी खास फ़्रेमवर्क पर निर्भर है?

नहीं। ये सिद्धांत किसी भी तकनीकी स्टैक में लागू होने के लिए हैं।

क्या यह फ़ोल्डर लेआउट बताता है?

नहीं। भौतिक लेआउट आपकी टीम चुनती है, और सिद्धांत फिर भी लागू होते हैं।

क्या यह कोडिंग स्टाइल के नियमों का सेट है?

नहीं। यह संरचना और सीमाओं के बारे में है, कोड स्टाइल के बारे में नहीं।

जानकारी

लेखक का मूल विवरण

Technology-agnostic guidance for modular systems: bounded contexts, clear boundaries, composability, state isolation, explicit contracts, failure containment, scaffolding workflows, split/merge criteria, sub-units inside a context, and compliance review signals. Use when designing or reviewing module structure, service boundaries, package layout, cross-cutting dependencies, "how should we split this?", modularity assessments, coupling between domains, greenfield context design, or architecture discussions without assuming a specific framework, language, or repository layout. Do NOT use for exe

repo: tech-leads-club/agent-skills

लोकप्रियता

GitHub स्टार
7.1k
रैंकिंग में स्थान
#13510
लाइसेंस
—
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

component-common-domain-detection

7.1k

यह आपके एजेंट को कोडबेस के कई हिस्सों में दोहराए गए बिज़नेस लॉजिक को ढूँढने और उन्हें मिलाने का तरीका सुझाने में मदद करती है।

कोडिंगसामान्य कोडिंग

component-flattening-analysis

7.1k

यह आपके एजेंट को गलत जगह रखा गया कोड ढूँढने और उलझे हुए कंपोनेंट फ़ोल्डर ढाँचे को सीधा करने में मदद करती है, ताकि हर चीज़ अपनी सही जगह रहे।

कोडिंगसामान्य कोडिंग

component-identification-sizing

7.1k

यह आपके एजेंट को कोडबेस के हिस्सों का नक्शा बनाने और उनका आकार मापने में मदद करती है, ताकि पता चले कि पहले किस मॉड्यूल को तोड़ना है।

कोडिंगसामान्य कोडिंग

coupling-analysis

7.1k

यह आपके एजेंट को जाँचने में मदद करती है कि कोडबेस के हिस्से एक-दूसरे पर कितनी कसकर निर्भर हैं, और पहले कौन से जोड़ ढीले करने चाहिए।

कोडिंगसामान्य कोडिंग

मिलती-जुलती skills