Grade the structure of a TypeScript or JavaScript codebase from A to F with unknot, by its knot index, and compare it with the public leaderboard of popular AI repositories. Use when asked how clean, tangled or well structured a codebase is, for an architecture score or grade, or for an unknot badge.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Score?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/patternvoid-score)
---
name: score
description: Grade the structure of a TypeScript or JavaScript codebase from A to F with unknot, by its knot index, and compare it with the public leaderboard of popular AI repositories. Use when asked how clean, tangled or well structured a codebase is, for an architecture score or grade, or for an unknot badge.
argument-hint: "[dir]"
---
# Grade the codebase
```bash
npx --yes unknot@0.2.1 $ARGUMENTS --score
```
The line looks like `unknot score: B knot index 24.7 (38 findings in 1808 files)`. Known debt counts too: the grade describes the whole codebase, not only what is new. A project under 50 source files prints `not graded`.
The knot index is the weighted findings divided by the file count plus 300, times 1000; lower is better. Grades: A up to 18, B up to 27, C up to 36, D up to 48, F above. The same scale ranks the most starred TypeScript repositories of the AI ecosystem: https://github.com/PatternVoid/unknot/blob/main/LEADERBOARD.md
Tell the user the grade, the number, and what drives it. To see the drivers run `npx --yes unknot@0.2.1 $ARGUMENTS --all` and group the findings by rule: a folder cycle weighs the most (5, plus 0.5 for every folder beyond two), then file cycles, tangles, field leaks and `forwardRef` (3 each), wrappers, wide injections and prop drilling (2 each), long files and wide folders (1 each). `shared-state`, `wide-component` and `duplicate-type` are reported and do not weigh in the grade yet.
For a README badge:
```bash
npx --yes unknot@0.2.1 $ARGUMENTS --badge
```