Skip to content
Back to skills

Libutil

ASecurity

libutil - General utilities. countTokens and estimateTokens for GPT-style token counting. generateHash creates SHA256 hashes. generateUuid creates unique IDs findProjectRoot locates repository root. updateEnvFile modifies environment files. exec runs child processes. createBundler downloads code bundles. Use for token counting, hashing, and project utilities.

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 2, 2026
ai-agentsjavascriptjava

Security analysis

A100/100

Scanned September 2, 2026

npx -y skills add majiayu000/claude-skill-registry --skill libutil --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Libutil?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Libutil
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-libutil/badge)](https://www.skillsdirectory.com/skills/majiayu000-libutil)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: libutil
description: >
  libutil - General utilities. countTokens and estimateTokens for GPT-style
  token counting. generateHash creates SHA256 hashes. generateUuid creates
  unique IDs findProjectRoot locates repository root. updateEnvFile modifies
  environment files. exec runs child processes. createBundler downloads code
  bundles. Use for token counting, hashing, and project utilities.
---

# libutil Skill

## When to Use

- Counting tokens for LLM context management
- Generating hashes and UUIDs
- Finding project root directory
- Running child processes
- Managing generated code bundles

## Key Concepts

**Token counting**: GPT-compatible tokenization for context window management.

**Project root**: Finds repository root by looking for package.json markers.

**Bundle management**: Download and extract pre-generated code bundles.

## Usage Patterns

### Pattern 1: Count tokens

```javascript
import { countTokens, estimateTokens } from "@copilot-ld/libutil";

const exact = countTokens("Hello, world!"); // Accurate count
const fast = estimateTokens("Hello, world!"); // Quick estimate
```

### Pattern 2: Generate identifiers

```javascript
import { generateHash, generateUuid } from "@copilot-ld/libutil";

const hash = generateHash(content); // 16-char SHA256
const uuid = generateUuid(); // Standard UUID
```

### Pattern 3: Find project root

```javascript
import { findProjectRoot } from "@copilot-ld/libutil";

const root = await findProjectRoot(); // /path/to/copilot-ld
```

## Integration

Used across packages for common utilities. countTokens used by libmemory.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.