Skip to content

Latest commit

 

History

History
66 lines (44 loc) · 3.27 KB

File metadata and controls

66 lines (44 loc) · 3.27 KB

CLAUDE.md — maintainer guide

Architecture and conventions for working on this repo. If you are here to use gen-z, see README.md. This file is for editing it.

What this repo is

One personality (the gen-z voice) packaged as an installable skill for 30+ AI coding agents, plus a Node installer that detects which agents are on a machine and installs the right form for each. gen-z ships a voice: it changes how the agent talks, never what it knows.

Sources of truth vs generated files

Edit the sources. Everything under plugins/ and dist/ is generated by node bin/sync.js and rebuilt by CI on every push to main. Edits there get reverted.

Concern Source of truth
The voice skills/gen-z/PERSONALITY.md
Calibration examples skills/gen-z/examples.md
Activation rules + frontmatter skills/gen-z/SKILL.md
Slang glossary skills/gen-z/references/lingo.md
Presets + levels reference skills/gen-z/references/presets.md
Auto-activation rule (Cursor/Windsurf/Cline/Copilot) src/rules/gen-z-activate.md
Per-agent ruleset files AGENTS.md, GEMINI.md (copied from the rule file)
Claude Code hooks src/hooks/gen-z-*.js
settings.json read/write bin/lib/settings.js
Supported agents bin/install.js (the PROVIDERS array)
Slash commands commands/gen-z*.{md,toml}

After editing a source, run node bin/sync.js.

The mode model

gen-z has two composed dials, stored together in $CLAUDE_CONFIG_DIR/.gen-z-mode as <preset>:<level>:

  • Audience preset (work / full / gc / dm) — who you are talking to.
  • Intensity level (lite / full / full-send) — how strong the voice runs.

off in that file disables the mode without uninstalling. src/hooks/gen-z-config.js parses and writes it (symlink-safe); src/hooks/gen-z-activate.js reads it on SessionStart and emits a preset+level-specific instruction block plus PERSONALITY.md; src/hooks/gen-z-set-mode.js is the writer that /gen-z <arg> calls.

Hook invariants (do not break these)

  • Hooks silent-fail on filesystem errors. A throwing SessionStart hook blocks the whole session. Swallow the error and exit clean.
  • settings.json goes through bin/lib/settings.js. JSONC-tolerant. A bare JSON.parse crashes on one // comment.
  • Validate hook entries before writing. Claude Code's Zod discards the entire settings.json on one malformed hook. Use validateHookFields().
  • Honor CLAUDE_CONFIG_DIR. Never hardcode ~/.claude.
  • Symlink-safe flag writes. safeWriteFlag() uses O_NOFOLLOW and rejects a symlinked parent.

After editing hooks

Regenerate the integrity manifest:

cd src/hooks && shasum -a 256 gen-z-activate.js gen-z-config.js gen-z-set-mode.js > checksums.sha256

Then node bin/sync.js to re-mirror the plugin.

Tests

npm test    # node --test on the installer + settings helper + mode config

Tests must skip cleanly when an optional dependency (a specific agent, a network) is missing. Never gate the whole suite on one being present.

Release

Bump version in package.json, plugins/gen-z/.claude-plugin/plugin.json, gemini-extension.json, and the PINNED_REF in bin/install.js. Regenerate checksums, run node bin/sync.js, tag.