Agent skill
rule-module-boundaries
Rule mapping for module-boundaries
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/rule-module-boundaries-carrot-foundation-methodology-rules
SKILL.md
Rule module-boundaries
Apply this rule whenever work touches:
libs/**/*.ts
Nx enforces strict module boundaries to keep the dependency graph clean and prevent coupling between unrelated parts of the codebase.
Dependency rules
The architecture enforces a layered dependency model:
apps/methodologies/* --> libs/methodologies/bold/rule-processors/*
|
v
libs/shared/* (helpers, lambda, rule, testing, etc.)
Key constraints:
- Processors depend on shared only. A rule processor under
libs/methodologies/bold/rule-processors/mass-id/can import fromlibs/shared/*but never fromlibs/methodologies/bold/rule-processors/credit-order/. - Shared libraries are independent. Shared libraries should not depend on processors or apps.
- No circular references. If library A imports from library B, then B must not import from A.
Path aliases
Always use the configured path aliases for cross-library imports:
// Correct
import { getDocumentField } from '@carrot-fndn/shared/methodologies/bold/helpers';
import { stubDocument } from '@carrot-fndn/shared/testing';
// Wrong
import { getDocumentField } from '../../../shared/methodologies/bold/helpers/src';
Verifying boundaries
Use the Nx dependency graph to check for violations:
pnpm nx graph
pnpm nx lint <project-name> # includes module boundary checks
The @nx/enforce-module-boundaries ESLint rule will flag any import that violates the configured constraints.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?