# fix-cyclic-deps

> Claude/Codex skill by [@ui5](https://omgskills.com/library/ui5/index.md) · 41 stars · Updated 2026-10-20

Detect and resolve cyclic module dependencies introduced during UI5 modernization. Trigger when user mentions: "cyclic dependency", "circular import", "undefined module at runtime", "lazy require", "sap.ui.require sync", "import cycle", or when a module returns undefined despite a correct import path. Classic symptom: a module is \`undefined\` at runtime despite a correct sap.ui.define import path. Auto-fixes 2-node cycles (A↔B) by converting the lesser-used edge to lazy sap.ui.require(). Auto-fixes longer chains (3+ nodes) via hub-based approach. Reports unfixable chains to MODERNIZATION-ISSUES.md. Runs as Phase 3, Step 3.3 (final step) after all other Phase 3 steps.

Tags: claude, development, openui5, plugin, sapui5, ui5

## Install

```sh
git clone https://github.com/UI5/plugins-coding-agents /tmp/plugins-coding-agents && ln -s /tmp/plugins-coding-agents/plugins/ui5-modernization/skills/fix-cyclic-deps ~/.claude/skills/fix-cyclic-deps
```

## From README

Fix Cyclic Module Dependencies This skill detects and resolves cyclic module dependencies that arise during UI5 modernization. When modernization converts global namespace access to sap.ui.define imports, new dependency edges can create circular imports (A imports B, B imports A), causing the UI5 AMD loader to return undefined for the back-edge module. The fix: replace the back-edge sap.ui.define dependency with a lazy sap.ui.require("path/to/Module") (synchronous form) at each call site, retrieving the already-loaded module from the loader cache without creating a dependency edge. Linter Rule | Rule ID | Message Pattern | This Skill's Action | |---------|-----------------|---------------------| | (none — structural) | Runtime: module is undefined despite correct import path | Detect cycle in dependency graph, convert back-edge to lazy sap.ui.require() | This skill is NOT triggered by a UI5 linter rule. It addresses a structural problem in the module dependency graph.

## Links

- HTML page: https://omgskills.com/library/ui5/plugins-coding-agents/plugins/ui5-modernization/skills/fix-cyclic-deps/
- GitHub: https://github.com/UI5/plugins-coding-agents
- Author: [@ui5](https://omgskills.com/library/ui5/index.md)

## More from this repo

- [fix-bootstrap-params](https://omgskills.com/library/ui5/plugins-coding-agents/plugins/ui5-modernization/skills/fix-bootstrap-params/index.md) — Used to fix HTML bootstrap parameter issues that UI5 linter reports but cannot auto-fix.
   - [@ui5](https://omgskills.com/library/ui5/index.md) · 41 stars
- [fix-component-async](https://omgskills.com/library/ui5/plugins-coding-agents/plugins/ui5-modernization/skills/fix-component-async/index.md) — Used to fix Component.js async configuration issues that UI5 linter reports but cannot auto-fix.
   - [@ui5](https://omgskills.com/library/ui5/index.md) · 41 stars
- [fix-control-renderer](https://omgskills.com/library/ui5/plugins-coding-agents/plugins/ui5-modernization/skills/fix-control-renderer/index.md) — Used to fix Control renderer issues that UI5 linter reports but cannot auto-fix.
   - [@ui5](https://omgskills.com/library/ui5/index.md) · 41 stars
