analyzing-backend-bundle
Skill by TriliumNext
Analyzes the TriliumNext server and desktop backend bundles to show what loads at startup. It joins runtime recordings with the esbuild metafile and explains why each package is eager.
Install analyzing-backend-bundle
Built from the published package, never by AI.
git clone --depth 1 https://github.com/TriliumNext/Trilium /tmp/Trilium && mkdir -p ~/.claude/skills && cp -r /tmp/Trilium/.claude/skills/analyzing-backend-bundle ~/.claude/skills/analyzing-backend-bundleRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install analyzing-backend-bundle in Claude Code
git clone --depth 1 https://github.com/TriliumNext/Trilium /tmp/Trilium && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/Trilium/.claude/skills/analyzing-backend-bundle ~/.gemini/antigravity-cli/skills/analyzing-backend-bundleAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install analyzing-backend-bundle in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill analyzes the esbuild ESM output of the TriliumNext backend bundles in apps/server/dist and apps/desktop/dist. It records which dist files the server loads at boot, then joins that list with the esbuild metafile to report eager and lazy totals, per-package composition, and the biggest eager chunks. A shortest static import chain shows why a package is eager.
The tools are zero-dependency scripts in the skill folder. They also check dynamic-import seams for a CommonJS interop break, profile RSS and heap usage, benchmark startup time, and list heap strings that are retained. The skill is aimed at developers who change backend lazy-loading and need runtime evidence before and after a change. It tells assistants not to write new module-hook loggers, metafile joiners, or heap-snapshot parsers, because these already exist in the folder.
Written from the project's SKILL.md and checked against it.
What it can do
- Record startup loadsRecords which dist/ files the server loads at startup, as ground truth from a real boot.
- Startup set analysisJoins the recording with the esbuild metafile to report eager vs lazy totals and the biggest eager chunks.
- Explain eagernessShows the shortest static import chain from the entry that makes a package eager.
- Bundle compositionLists whole-bundle composition by package without booting the server.
- Check dynamic importsCompares names destructured from each dynamic import against the target chunk's exports to catch CJS interop breaks.
- Memory profilingMeasures RSS and post-GC heap, with an optional heap snapshot.
- Startup benchmarkMeasures median time from spawn to first HTTP response over N runs.
- Heap string retentionShows which chunk source strings are resident in the heap from a heap snapshot.
What you need
- Node.js (the source reports Node 22 for its reference numbers)
- A built server bundle in apps/server/dist
- Optional: a scratch copy of a real document.db for realistic numbers
Try asking
- What does the TriliumNext server load at startup?
- Why is undici in the backend startup set?
- How big is the eager set after I add a dynamic import seam?
Good to know
- record and profile-bundle boot the real server and need a suitable environment.
- The desktop main.mjs cannot boot under plain node because it imports electron; only packages and why work on its metafile.
- NODE_V8_COVERAGE does not capture the loaded-script list in this setup.
- Heap snapshots are about 70 to 90 MB on disk.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .claude/skills/analyzing-backend-bundle/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md10 KB -
analyze-bundle.mjs10 KB -
bench-startup.mjs2 KB -
check-dynamic-imports.mjs3 KB -
heap-strings.mjs3 KB
Show all 7 files
-
loghook.cjs602 B -
profile-bundle.cjs3 KB
Alternatives to analyzing-backend-bundle
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
analyzing-backend-bundle: common questions
Do I need to run the server to use this?
The record and profile-bundle tools boot the real server. The packages and why commands work directly on the metafile without booting.
Why is a package eager if my code imports it dynamically?
A dynamic import that runs during boot loads its chunk anyway. The why command shows the static chain that keeps the package in the startup set.
Why does destructuring a CommonJS dynamic import return undefined?
esbuild cannot know CommonJS named exports, so the split ESM chunk exports only default. Read names through mod.default ?? mod instead.
How do I install analyzing-backend-bundle?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is analyzing-backend-bundle free?
The code is published under the AGPL-3.0 licence. The service it connects to may have its own pricing.
Is analyzing-backend-bundle safe to use?
It scores 87 of 100. Grades: maintenance A, licence C, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to analyzing-backend-bundle?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
