Skip to content
Back to skills

Libsecret

ASecurity

libsecret - Secret generation and environment utilities. generateSecret creates cryptographic random secrets. generateSecretB64 creates base64url secrets. createJwt signs HS256 JSON Web Tokens. getEnvVar and setEnvVar manage .env files. hashValues creates deterministic hashes. Use for credential management, JWT creation, and environment configuration.

  • 4 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 12, 2026
securityjavascriptjavaapi

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 12, 2026

npx -y skills add aibot88/sec_skill_store --skill libsecret --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Libsecret?

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

Security grade badge for Libsecret
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aibot88-libsecret/badge)](https://www.skillsdirectory.com/skills/aibot88-libsecret)

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: libsecret
description: >
  libsecret - Secret generation and environment utilities. generateSecret
  creates cryptographic random secrets. generateSecretB64 creates base64url
  secrets. createJwt signs HS256 JSON Web Tokens. getEnvVar and setEnvVar manage
  .env files. hashValues creates deterministic hashes. Use for credential
  management, JWT creation, and environment configuration.
---

# libsecret Skill

## When to Use

- Generating cryptographic secrets for APIs
- Creating and signing JWTs
- Managing .env file variables
- Creating deterministic hashes from values

## Key Concepts

**Secret generation**: Cryptographically secure random string generation for API
keys and tokens.

**JWT creation**: HS256-signed JSON Web Tokens for authentication.

**Environment management**: Read/write .env files programmatically.

## Usage Patterns

### Pattern 1: Generate secrets

```javascript
import { generateSecret, generateSecretB64 } from "@copilot-ld/libsecret";

const apiKey = generateSecret(); // hex string
const token = generateSecretB64(); // base64url string
```

### Pattern 2: Manage .env variables

```javascript
import { getEnvVar, setEnvVar } from "@copilot-ld/libsecret";

await setEnvVar(".env", "API_SECRET", secret);
const value = await getEnvVar(".env", "API_SECRET");
```

### Pattern 3: Create JWT

```javascript
import { createJwt } from "@copilot-ld/libsecret";

const jwt = createJwt({ userId: "123" }, secret, { expiresIn: "1h" });
```

## Integration

Used during setup scripts and initialization. Called by scripts/env-secrets.js.

Files in this skill

  • SKILL.md1.5 KB
  • source.json846 B

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.