typescript-circular-dependency SKILL.md skillA

typescript-circular-dependency from ckorhonen/claude-skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add ckorhonen/claude-skills/typescript-circular-dependency@v1.0.0

Pins v1.0.0 in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 19 of 19 checks passed
Kind
SKILL.md skill
Repository
ckorhonen/claude-skills
Path
skills/continuous-learning/examples/typescript-circular-dependency/SKILL.md
Versions recorded
1
Latest version
v1.0.0, committed Jan 19, 2026
Size
5,731 bytes
Repository stars
28
License
MIT

Detect and resolve TypeScript/JavaScript circular import dependencies. Use when: (1) "Cannot access 'X' before initialization" at runtime, (2) Import returns undefined unexpectedly, (3) "ReferenceError: Cannot access X before initialization", (4) Type errors that disappear when you change import order, (5) Jest/Vitest tests fail with undefined imports that work in browser.

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# TypeScript Circular Dependency Detection and Resolution

## Problem

Circular dependencies occur when module A imports from module B, which imports 
(directly or indirectly) from module A. TypeScript compiles successfully, but at 
runtime, one of the imports evaluates to `undefined` because the module hasn't 
finished initializing yet.

## Context / Trigger Conditions

Common error messages:

```
ReferenceError: Cannot access 'UserService' before initialization
```

```
TypeError: Cannot read properties of undefined (reading 'create')
```

```
TypeError: (0 , _service.doSomething) is not a function
```

Symptoms that suggest circular imports:

- Import is `undefined` even though the export exists
- Error only appears at runtime, not during TypeScript compilation
- Moving an import statement changes which import is undefined
- Tests fail but the app works (or vice versa)
- Adding `console.log` at the top of a file changes behavior

## Solution

### Step 1: Detect the Cycle

Use a tool to visualize dependencies:

```bash
# Install madge
npm install -g madge

# Find circular dependencies
madge --circular --extensions ts,tsx src/

# Generate visual graph
…

Read the whole file at its exact version.

How to install

No tool to install first
claude plugin marketplace add https://markdownregistry.com/mp/a/art_s67in6ifuaoowazk/b05ad87becdc37c0d0d862770cd2fb038ec8ed4dc6e6506b1f663fcba762d53c.json

Then /plugin install typescript-circular-dependency@markdownregistry-s67in6ifuaoowazk in Claude Code. It installs v1.0.0, the one graded A here, pinned to the commit it was graded at, and leaves it there.

The exact contents, by fingerprint
mdr add ckorhonen/claude-skills/typescript-circular-dependency@sha256:b05ad87becdc37c0

The line at the top of this page pins the label v1.0.0, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_s67in6ifuaoowazk.svg)](https://markdownregistry.com/a/art_s67in6ifuaoowazk)

2 badge image fetches in 30 days. What the badge shows.

Ask from your agent
claude mcp add --transport http markdownregistry https://markdownregistry.com/mcp/registry

Then ask it: what changed in ckorhonen/claude-skills/typescript-circular-dependency since the version I have? It reads every saved version here, no key and no account. Any agent that speaks MCP can add it.

Got a copy of typescript-circular-dependency from somewhere else? Ask it: where did my typescript-circular-dependency come from, and what was changed? It names the public original, the version yours is closest to and every changed line. The text is not kept.

Versions

The registry has recorded 1 version of this file, committed on Jan 19, 2026.

Watch this file (sign in, one email per new version)

versioncommittedcommitsizeaudit
v1.0.0 latest2026-01-19 509fc74 5,731 BA view
Keep it current by itself, install once

Committed this skill to a repository? Install the markdownregistry skill updates app on it, or on all of them. When the registry saves a newer version, a pull request brings your copy to it within minutes, the newest version first, then what changed and any check it newly trips. A copy you edited is never touched, and nothing is deleted.

Install on GitHub

It asks to read and write contents and pull requests, and to read metadata. No workflow file, no Actions setting, nothing runs on your runners. Uninstall it and everything the registry kept about your repository is deleted.

Keep it current by itself

Committed this skill to a repository? Add one workflow file, and when a newer version is saved, a pull request brings your copy to it, the newest version first, then what changed and any check it newly trips. A copy you edited is never touched, and nothing is deleted.

mkdir -p .github/workflows && curl -fsSL https://markdownregistry.com/ci/skill-updates.yml -o .github/workflows/skill-updates.yml

It runs daily on GitHub Actions, no key and no account. Read the workflow before you add it.

Check a whole project

From the root of your project, one line hashes each installed skill's SKILL.md, your AGENTS.md and your CLAUDE.md, and asks the registry once. Only the fingerprints and paths are sent.

sha256sum .claude/skills/*/SKILL.md AGENTS.md CLAUDE.md | curl -s --data-binary @- https://markdownregistry.com/api/v1/check-copies

In CI, add --fail-with-body: the answer is 409 when any file is behind, so the step fails and still prints which files.

sha256sum .claude/skills/*/SKILL.md AGENTS.md CLAUDE.md | curl -s --fail-with-body --data-binary @- https://markdownregistry.com/api/v1/check-copies

No sha256sum on your machine? shasum -a 256 prints the same lines.

Audit of the latest version

A  19 of 19 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (5731 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No encoded command decoded and run in a shell
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No decoded text run in a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

ckorhonen/claude-skills · 28 stars · license MIT · pushed 2026-09-26 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_s67in6ifuaoowazk
GET https://markdownregistry.com/api/v1/resolve?ref=ckorhonen/claude-skills/typescript-circular-dependency
GET https://markdownregistry.com/api/v1/blob/b05ad87becdc37c0d0d862770cd2fb038ec8ed4dc6e6506b1f663fcba762d53c
GET https://markdownregistry.com/api/v1/list?kind=skill

Every file of this kind listed here, most starred first, in pages: send each page's next back as cursor. JSON, no key.

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from ckorhonen/claude-skills

AGENTS.md AGENTS.md file
ckorhonen/claude-skills · AGENTS.md
git:20260926.947001b · audit A · 28 stars
CLAUDE.md CLAUDE.md file
ckorhonen/claude-skills · CLAUDE.md
git:20260705.8659351 · audit B · 28 stars
agent-browser SKILL.md skill
ckorhonen/claude-skills · skills/agent-browser/SKILL.md · Automate headless browser interactions using agent-browser CLI. Use when scraping web pages, automating form…
git:20260322.3078727 · audit A · 28 stars
agent-engineering SKILL.md skill
ckorhonen/claude-skills · skills/agent-engineering/SKILL.md · Battle-tested engineering principles for AI coding agents. Covers plan-first workflow, subagent delegation…
git:20260328.f27ce6f · audit A · 28 stars
app-marketing-copy SKILL.md skill
ckorhonen/claude-skills · skills/app-marketing-copy/SKILL.md · Write marketing copy and App Store / Google Play listings (ASO keywords, titles, subtitles, short+long descriptions…
git:20260328.f27ce6f · audit A · 28 stars
ascii-pixel-art SKILL.md skill
ckorhonen/claude-skills · skills/ascii-pixel-art/SKILL.md · Generate animated ASCII art from images with subject detection, blurred pixelated backgrounds, and dynamic visual…
git:20260328.f627e37 · audit A · 28 stars
autopredict SKILL.md skill
ckorhonen/claude-skills · skills/autopredict/SKILL.md · Wrap the howdymary/autopredict Polymarket trading-agent repo. Use when you need to scan live Polymarket markets…
git:20260328.f627e37 · audit A · 28 stars
autoresearch SKILL.md skill
ckorhonen/claude-skills · skills/autoresearch/SKILL.md · Run a rigorous autonomous experiment loop for any optimization target using explicit hypotheses, repeated trials…
git:20260328.1268a4c · audit A · 28 stars
babysit-pr SKILL.md skill
ckorhonen/claude-skills · skills/babysit-pr/SKILL.md · Create, monitor, and shepherd a GitHub pull request end-to-end: respect repo PR templates, watch CI and reviews, fix…
git:20260320.352a7c4 · audit A · 28 stars
bird-fast SKILL.md skill
ckorhonen/claude-skills · skills/bird-fast/SKILL.md · Post tweets, read threads, search X/Twitter from the terminal using the bird CLI. Use when automating Twitter/X…
git:20260328.4cd3723 · audit A · 28 stars
blockchain-auditor SKILL.md skill
ckorhonen/claude-skills · skills/blockchain-auditor/SKILL.md · Security audit smart contracts for exploitable vulnerabilities from an unprivileged context. Use when analyzing…
git:20260328.53fe880 · audit B · 28 stars
brainstorming SKILL.md skill
ckorhonen/claude-skills · skills/brainstorming/SKILL.md · Explore user intent, requirements and design before implementation through structured dialogue and design proposals…
git:20260328.1268a4c · audit A · 28 stars

Every file in ckorhonen/claude-skills

Browse by kind, by grade A, or by owner.