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.
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.
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.
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.
- Hooks silent-fail on filesystem errors. A throwing
SessionStarthook blocks the whole session. Swallow the error and exit clean. - settings.json goes through
bin/lib/settings.js. JSONC-tolerant. A bareJSON.parsecrashes on one//comment. - Validate hook entries before writing. Claude Code's Zod discards the entire
settings.jsonon one malformed hook. UsevalidateHookFields(). - Honor
CLAUDE_CONFIG_DIR. Never hardcode~/.claude. - Symlink-safe flag writes.
safeWriteFlag()usesO_NOFOLLOWand rejects a symlinked parent.
Regenerate the integrity manifest:
cd src/hooks && shasum -a 256 gen-z-activate.js gen-z-config.js gen-z-set-mode.js > checksums.sha256Then node bin/sync.js to re-mirror the plugin.
npm test # node --test on the installer + settings helper + mode configTests must skip cleanly when an optional dependency (a specific agent, a network) is missing. Never gate the whole suite on one being present.
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.