agentleFS
flavien-iaflavien-ia/hypervibe-harness/skills/_generate-secret/SKILL.md

_generate-secret

Skill50 starsChanged 21 days agoApache-2.0View on GitHub

Internal helper to generate a cryptographically secure random secret (API key, JWT secret, webhook secret, CRON_SECRET, etc.). Delegates to the bundled scripts/generate-secret.mjs. Shell-safe by default. Invoked by skills that need a fresh secret (add-auth AUTH_SECRET, add-cron CRON_SECRET, webhook secrets). Not meant to be invoked directly by users.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use plain, non-technical business language.

    line 13
  2. Distinctive:

    When generating user-facing content for the scaffolded project (UI labels, emails, copy), write it in the user's language too.

    line 14
  3. Very specific:

    Always: use this helper (never inline require('crypto').randomBytes(...)).

    line 45
  4. Very specific:

    Never log the secret or write it to a file.

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Generate Secret - Internal helper

Communication

  • Detect the user's language from the conversation (the user's own messages, anywhere in the session - not just this invocation: a bare slash command like /bootstrap carries no language signal by itself). If nothing in the conversation gives a signal, fall back to the OS locale (node -e "console.log(Intl.DateTimeFormat().resolvedOptions().locale)") before defaulting to English. ALWAYS reply in that language for every user-facing message: questions, progress, confirmations, summaries, errors - including any example text quoted in this skill, which is illustrative and must be translated, never sent verbatim.
  • Use plain, non-technical business language. Never expose internal script names (*.mjs) or jargon; describe actions in human terms.
  • When generating user-facing content for the scaffolded project (UI labels, emails, copy), write it in the user's language too.
  • Show progress as a short natural-language checklist (in-progress and done states).

Generate a cryptographically secure random secret. Delegates to a bundled Node script - never reimplement inline.

Invocation

node "${CLAUDE_SKILL_DIR}/../../scripts/generate-secret.mjs" [--format FORMAT] [--length N]

Output: the secret on stdout, no trailing newline. Capture it with SECRET=$(node ...) or pipe it into the next step.

Formats

FormatChar setSize ruleTypical use
hex (default)[0-9a-f]length = byte count → 2*N charsWebhook secrets, CRON_SECRET. Default length 32 = 256-bit entropy.
base64url[A-Za-z0-9_-]length = byte count → ~1.33*N charsNextAuth AUTH_SECRET, URL-safe tokens.
alphanumeric[A-Za-z0-9]length = char count (exactly N)Human-typeable admin passwords. Use length 24.

⚠️ Never use raw base64 (contains /, +, = which break URLs and env vars). Always prefer base64url.

Typical usage

  • CRON_SECRET → node ...generate-secret.mjs (hex, 32 bytes = 64 hex chars)
  • AUTH_SECRET (NextAuth) → node ...generate-secret.mjs --format base64url
  • Random admin password for production → admin-password.mjs rotate (see _hash-password): it generates it, writes it in a file of the user's downloads folder and pushes only its hash, so the password never appears in the conversation

Rules

  • Always use this helper (never inline require('crypto').randomBytes(...)).
  • Never log the secret or write it to a file. Pipe it straight to _push-env-vars or the next operation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.