Agent skill

Fractal File Structuring

by hashintel in hashintel/hash

A skill your agent uses when creating, moving, splitting, or organizing TypeScript files and folders.

MITAuto-check passedFrontend & Design

Install Fractal File Structuring

skills CLI
$ npx skills add hashintel/hash --skill fractal-file-structuring -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install hashintel/hash fractal-file-structuring --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/hashintel/hash.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/fractal-file-structuring .claude/skills/fractal-file-structuring && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
fractal-file-structuring
GitHub stars
1.7k
Token cost
~2.2k tokens
SKILL.md length
803 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when creating, moving, splitting, or organizing TypeScript files and folders.

  • Works in 7 steps: Identify the semantic concept the file… → Name the file or folder in kebab-case. → If extracting from an existing file, put… → …
  • Organizing TypeScript files and folders
  • SKILL.md covers Scope, Core Rules, Decision Checklist and When Unsure
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Fractal File Structuring is an agent skill from hashintel/hash. Use when creating, moving, splitting, or organizing TypeScript files and folders. Applies fractal tree file-structuring rules which reduce the cognitive overhead of choosing where to put files and ultimately navigating a codebase (once the structure is established and understood).

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design, covering React components. It works with TypeScript and JavaScript. The repository describes itself as: 🚀 The open-source, multi-tenant platform for self-building knowledge graphs and simulation. The licence is MIT.

When your agent uses it

  • Organizing TypeScript files and folders
  • Tasks that involve React components

Example prompts

  • “/fractal-file-structuring”

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Identify the semantic concept the file represents.
  2. Name the file or folder in kebab-case.
  3. If extracting from an existing file, put private implementation files under a same-named folder.
  4. If multiple current branches need the resource, put it in the nearest shared/ folder.
  5. Avoid index files and implicit folder imports.
  6. Use relative imports within the workspace.
  7. Co-locate tests with the file under test.

What it can do on your machine

Read from SKILL.md and the folder at commit e189ab2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • hash.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Fractal File Structuring loads about 2.2k tokens when it runs. Until then it costs about 77 tokens; SKILL.md has 803 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~77
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from hashintel/hash at commit e189ab2, republished under its MIT licence (© hashintel). 803 words, ~2,153 tokens.

Download SKILL.mdSave it as .claude/skills/fractal-file-structuring/SKILL.md (or your agent's skills folder).
name
fractal-file-structuring
description
Use when creating, moving, splitting, or organizing TypeScript files and folders. Applies fractal tree file-structuring rules which reduce the cognitive overhead of choosing where to put files and ultimately navigating a codebase (once the structure is established and understood).
license
MIT

Fractal File Structuring

TypeScript and JavaScript files should be organised in a fractal tree structure. Use this skill when deciding where to create, move, split, or organize files and folders in a TypeScript or JavaScript workspace.

This guidance is based on HASH's file-structuring approach: https://hash.dev/blog/file-structuring

Scope

Apply this skill to TypeScript and JavaScript source files, including modules, components, hooks, helpers, types, tests, scripts, and entry points.

Core Rules

Use kebab-case names

Use kebab-case for all TypeScript and JavaScript file and folder names.

text
create-worker-factory.ts
playback-settings-menu.tsx
button.tsx

Avoid PascalCase, camelCase, and mixed-case file names, even for React components.

Do not create index files

Do not add index.ts, index.tsx, index.js, or index.jsx files for folder imports. Prefer explicit file entry points with meaningful names.

If a subtree needs a public entry point, name that file after the concept it exposes (e.g. schema.ts)

Treat each file as a mini-library

A file should expose one or more named exports with a shared semantic purpose. The file name should summarize that purpose (e.g. users.ts)

If a file contains only one main export, prefer naming the file after that export in kebab-case (e.g. create-user.ts)

Avoid default exports unless a framework or external API requires them.

Split outgrown files into private subtrees

When a file becomes too large or contains implementation details worth extracting, create a same-named folder next to it and move private pieces there.

text
editor-view.tsx              # public mini-library: the component other files import
editor-view/
  panels.tsx                 # private entry point imported by editor-view.tsx
  panels/
    simulate-view.tsx        # private to panels.tsx
  calculate-timeline-range.ts # private helper used only by editor-view.tsx
  create-panel-state.ts       # private helper used only by editor-view.tsx

Only editor-view.tsx should import from direct child mini-libraries such as editor-view/panels.tsx and editor-view/calculate-timeline-range.ts. Only editor-view/panels.tsx should import from editor-view/panels/*.tsx. Other files should import from editor-view.tsx, not from its private subtree. This keeps editor-view.tsx as the API boundary and makes editor-view/ read as its implementation.

If editor-view/calculate-timeline-range.ts grows and needs its own private implementation files, create editor-view/calculate-timeline-range/. Only editor-view/calculate-timeline-range.ts should import from that deeper subtree.

text
editor-view/
  calculate-timeline-range.ts
  calculate-timeline-range/
    clamp-time.ts             # private to calculate-timeline-range.ts
    get-visible-duration.ts    # private to calculate-timeline-range.ts
Keep private subtrees private

Do not import directly from another file's implementation folder.

typescript
// Avoid: reaches into another file's private subtree
import { SimulateView } from "../editor-view/panels/simulate-view";

// Prefer (1): import from a public mini-library (if it is conceptually part of editor-view)
import { EditorView } from "../editor-view";

// Prefer (2): move shared code to a shared folder (if it is NOT conceptually part of editor-view)
import { Button } from "../shared/button";

If a resource must be available outside the subtree, re-export it from the subtree root only when it is part of that root's public concept. If it is independently useful to sibling branches, move it to an appropriate shared/ folder instead.

Put shared resources at the closest fork

When multiple sibling branches need the same helper, type, component, constant, or hook, place it in the nearest applicable shared/ folder.

text
editor-view.tsx
editor-view/
  shared/
    duration-label.tsx        # used by both panels.tsx and bottom-section.tsx
    playback-time.ts          # shared formatting/parsing logic for this subtree
  panels.tsx                  # imports from panels/
  panels/
    simulate-view.tsx         # private to panels.tsx
  bottom-section.tsx          # imports from bottom-section/
  bottom-section/
    bottom-bar.tsx            # private to bottom-section.tsx

Place shared files as deep as possible while still covering all current consumers. Do not move something to a high-level shared folder just because it might be reused later.

Here editor-view.tsx imports ./editor-view/panels and ./editor-view/bottom-section. panels.tsx may import ./panels/simulate-view and ./shared/duration-label; bottom-section.tsx may import ./bottom-section/bottom-bar and ./shared/duration-label. Nothing else should import from panels/ or bottom-section/ directly.

Shared files are mini-libraries too. A shared file can have its own private same-named subtree, and those internals should remain private to that shared file.

text
editor-view/
  shared/
    playback-time.ts          # public to editor-view/* branches
    playback-time/
      parse-playback-time.ts  # private to playback-time.ts
      format-playback-time.ts # private to playback-time.ts

If later only bottom-bar.tsx uses duration-label.tsx, move it beside bottom-bar.tsx or under bottom-bar/. The folder structure should describe current consumers, not preserve old sharing.

Show full SKILL.md (327 more words)Show less
Use relative imports within a workspace

For imports inside the same workspace, use relative paths. Do not introduce workspace-local aliases just to shorten paths.

Imports from other workspaces should use the package name.

Co-locate unit tests

Place unit tests next to the file they cover.

text
foo.ts
foo.test.ts

If a private extracted file needs direct tests, place those tests next to that extracted file.

text
editor-view.tsx
editor-view.test.tsx
editor-view/
  calculate-timeline-range.ts
  calculate-timeline-range.test.ts

Prefer testing through the public mini-library when that gives enough coverage. Add direct tests for private extracted files when the logic is complex enough that tests through the owner would be indirect or brittle.

Match the current shape

Organize files for the code's current relationships, not speculative future reuse. Moving files later is expected and cheaper than adding premature structure now.

Decision Checklist

Before creating a TypeScript or JavaScript file or folder:

  1. Identify the semantic concept the file represents.
  2. Name the file or folder in kebab-case.
  3. If extracting from an existing file, put private implementation files under a same-named folder.
  4. If multiple current branches need the resource, put it in the nearest shared/ folder.
  5. Avoid index files and implicit folder imports.
  6. Use relative imports within the workspace.
  7. Co-locate tests with the file under test.

When Unsure

Choose the location that communicates the file's current consumers and API boundary most clearly:

  • Private implementation detail: place it under the owning file's same-named folder, and import it only from that owner.
  • Named mini-library: create a normal named file when the concept has its own purpose and exports a small API for nearby consumers.
  • Shared mini-library: place the named file in the closest shared/ folder when multiple branches need that API.
  • Subtree entry point: expose the public API from a named root file, and keep any deeper implementation files private to that root.

Do not add broad components, hooks, utils, types, or services folders unless absolutely necessary. If they exist, these folders MUST only be imported from by files called components.ts, hooks.ts, etc.

© hashintel, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/fractal-file-structuring of hashintel/hash.

Open the folder on GitHubat commit e189ab2

Compare with similar skills

Fractal File Structuring next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Fractal File Structuring compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Fractal File Structuring this skillhashintel/hash1.7k—~2.2kAutomated safety check: PassMIT
Typescript Best Practicesbretzel-app/crumbs1271 repos~2.2kAutomated safety check: PassMIT
Connect Component To Figmadequelabs/cauldron129—~2kAutomated safety check: PassMPL-2.0
Fork And GoSimplePDF/simplepdf-embed407—~7.9kAutomated safety check: NotesMIT
Typescriptccusage/ccusage19k—~696Automated safety check: PassCustom licence
Javascript Practiceseser/stack128—~599Automated safety check: PassCustom licence

Similar skills

  • Typescript Best Practices

    bretzel-app/crumbs

    Provides TypeScript patterns for type-first development, making illegal states unrepresentable, exhaustive handling, and runtime validation.

    127 GitHub starsUsed in 1 repo~2.2k tokens
    Frontend & DesignAuto-check passed
  • Connect Component To Figma

    dequelabs/cauldron

    Add a Figma Code Connect (.figma.tsx) file for a Cauldron React component.

    129 GitHub stars~2k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Fork And Go

    SimplePDF/simplepdf-embed

    Guided walkthrough for forking and deploying your own SimplePDF Copilot: hosting choice, Pro-account confirmation, AI-provider wiring, demo customization, deploy, and the SimplePDF whitelist step.

    407 GitHub stars~7.9k tokensUpdated 7 days ago
    Frontend & DesignAuto-check: notes
  • Typescript

    ccusage/ccusage

    Guides ccusage TypeScript and JavaScript work. An agent skill from ccusage/ccusage.

    19k GitHub stars~696 tokensUpdated today
    Frontend & DesignAuto-check passed
  • TS and JS conventions for eserstack packages: namespace imports, mod.ts entries, cross-runtime APIs, explicit checks, async, tests and laroux React components.

    128 GitHub stars~599 tokensUpdated 3 days ago
    Frontend & DesignAuto-check passed
  • Typescript Rules

    softspark/ai-toolkit

    TypeScript/JavaScript coding rules: style, patterns, security, testing.

    179 GitHub stars~2.7k tokensUpdated today
    Testing & QAAuto-check: notes

More from hashintel/hash

All 17 skills in this repo
  • Documenting Rust Code

    hashintel/hash

    Rust documentation practices for HASH codebase. An agent skill from hashintel/hash.

    1.7k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Handling Rust Errors

    hashintel/hash

    HASH error handling patterns using error-stack crate. An agent skill from hashintel/hash.

    1.7k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Cargo.toml dependency management patterns for HASH workspace.

    1.7k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Testing Hashql

    hashintel/hash

    HashQL testing strategies including compiletest (UI tests), unit tests, and snapshot tests.

    1.7k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • HashQL diagnostic writing patterns using hashql-diagnostics crate.

    1.7k GitHub stars~724 tokensUpdated today
    Auto-check passed
  • Writing Hashql Jexpr

    hashintel/hash

    HashQL J-Expr syntax for writing queries. An agent skill from hashintel/hash.

    1.7k GitHub stars~1.2k tokensUpdated today
    Auto-check passed

Questions about Fractal File Structuring

What does Fractal File Structuring do?

A skill your agent uses when creating, moving, splitting, or organizing TypeScript files and folders. Fractal File Structuring is an agent skill from hashintel/hash. Use when creating, moving, splitting, or organizing TypeScript files and folders.

When should I use Fractal File Structuring?

Fractal File Structuring fits situations like: organizing TypeScript files and folders; tasks that involve React components.

How do I install Fractal File Structuring in Claude Code?

Run `npx skills add hashintel/hash --skill fractal-file-structuring -a claude-code`. Or copy the skill folder (.agents/skills/fractal-file-structuring in hashintel/hash) into .claude/skills/fractal-file-structuring in your project. Claude Code loads it when a task matches its description.

How do I install Fractal File Structuring in Codex?

Run `npx skills add hashintel/hash --skill fractal-file-structuring -a codex`. Or copy the skill folder (.agents/skills/fractal-file-structuring in hashintel/hash) into .agents/skills/fractal-file-structuring in your project. Codex loads it when a task matches its description.

Can I use Fractal File Structuring in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add hashintel/hash --skill fractal-file-structuring -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fractal-file-structuring, .gemini/skills/fractal-file-structuring, .github/skills/fractal-file-structuring and .opencode/skills/fractal-file-structuring in your project.

What does Fractal File Structuring need to run?

SKILL.md names no scripts, command-line tools or credentials: Fractal File Structuring is instructions for the agent only.

Does Fractal File Structuring access the network?

SKILL.md names 1 domain. As links in the text: hash.dev. This is read from the text; nothing was executed.

Is Fractal File Structuring safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Fractal File Structuring use?

Fractal File Structuring is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Fractal File Structuring use?

About 2.2k tokens (SKILL.md is roughly 8.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Fractal File Structuring?

Skills that share tags, products or a category with Fractal File Structuring: Typescript Best Practices (bretzel-app/crumbs, 127 stars), Connect Component To Figma (dequelabs/cauldron, 129 stars), Fork And Go (SimplePDF/simplepdf-embed, 407 stars) and Typescript (ccusage/ccusage, 19k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Fractal File Structuring?

hashintel (a GitHub organization) maintains it in hashintel/hash, which has 1,668 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 7, 2026.

Source: hashintel/hash on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.