This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Code Abyss is an npm package that installs persona configuration plus proactive execution guidance into Claude Code, Codex CLI, Gemini CLI, and OpenClaw. It delivers: persona rules, 5 switchable output styles, 26 skills, and 5 executable verification/generation tools.
npm test # Run Jest test suite
npm run verify:skills # Validate all SKILL.md frontmatter contracts (fail-fast gate)
node bin/install.js --help # Installer CLI help
node bin/install.js --target claude -y # Zero-config install to ~/.claude/
node bin/install.js --target codex -y # Zero-config install to ~/.codex/
node bin/install.js --target gemini -y # Zero-config install to ~/.gemini/
node bin/install.js --target openclaw -y # Zero-config install to ~/.openclaw/
node bin/install.js --list-styles # List available output stylesRunning individual verify tools directly:
node skills/analyzing-security/scripts/security_scanner.js <path>
node skills/verifying-modules/scripts/module_scanner.js <path>
node skills/analyzing-changes/scripts/change_analyzer.js --mode staged|working
node skills/checking-code-quality/scripts/quality_checker.js <path>
node skills/generating-docs/scripts/doc_generator.js <path>Running a single test file:
npx jest test/install-registry.test.js --runInBandCI runs on Node 18/20/22: npm ci && npm test && npm run verify:skills plus all 4 verify tools + smoke install/uninstall across Claude / Codex / Gemini / OpenClaw.
| Layer | Source | Purpose |
|---|---|---|
| Identity | config/personas/*.md |
Per-persona identity: role, personality, tone, scenario scripts |
| Shared Behavior | config/personas/_shared/*.md |
Iron laws, execution chains, skill routing, proactive protocol |
| Output Style | output-styles/*.md + index.json |
Style registry + per-style templates with {{self}}/{{user}}/{{language}} template variables |
All four targets use a single composition function renderRuntimeGuidance() that assembles: identity + shared behavior + style (with template variable substitution). Persona registry config/personas/index.json declares self/user/language fields per persona for cross-combination safety.
bin/lib/skill-registry.js is the authoritative skill discovery engine for installed skills, run_skill.js, Claude command generation, and CI validation.
- Each skill's metadata lives in
skills/**/SKILL.mdYAML frontmatter - Required fields:
name(kebab-case slug),description,user-invocable - Optional fields:
allowed-tools(default:Read),argument-hint,aliases categoryis auto-inferred from directory prefix (tools/→ tool,domains/→ domain,orchestration/→ orchestration)runtimeTypeis auto-inferred:scripts/has exactly one.js→scripted, elseknowledge- Registry fail-fast validates: missing fields, bad slugs, illegal tool names, duplicate names, multiple script entries
packs/*/manifest.json defines installable packs. abyss is the core pack; gstack is an optional pinned upstream pack installed only when a project lock declares it. bin/lib/pack-registry.js is the source of truth for host file mappings and upstream metadata.
Project-level automatic pack sync is driven by .code-abyss/packs.lock.json. The installer reads the nearest lock file from the current working directory upward and installs host-specific packs according to required, optional, optional_policy, and sources. node bin/packs.js bootstrap initializes the lock plus README/CONTRIBUTING snippets, --apply-docs writes them back into repo docs, vendor-pull / vendor-sync manage local sources, vendor-sync --check acts as a gate, report summary reads .code-abyss/reports/, and uninstall <pack> removes pack-specific runtime artifacts with a report.
bin/lib/style-registry.js manages output-styles/index.json. Exactly one style must be default. Each style has slug, label, description, file, targets, default.
The installer generates different artifacts per target CLI:
- Claude:
~/.claude/commands/*.md(optional slash commands) —runtimeType=scriptedcallsrun_skill.js,knowledgereads SKILL.md directly - Codex:
~/.codex/skills/**/SKILL.md— Code Abyss installs core skills directly under the Codex managed skills directory; generatedAGENTS.md+instruction.mdprovide proactive execution guidance - Gemini:
~/.gemini/GEMINI.md+~/.gemini/commands/*.toml+~/.gemini/skills/**/SKILL.md— Gemini reads persistent context fromGEMINI.md; commands are optional and generated only for invocable skills - OpenClaw:
~/.openclaw/skills/**/SKILL.md+<workspace>/AGENTS.md+<workspace>/SOUL.md— OpenClaw reads shared skills from~/.openclaw/skills/; workspace bootstrap files carry rules and persona/style
Claude command generation and Codex/Gemini skill installation share the same skill source tree; only user-invocable: true skills emit explicit commands, and the current core set defaults to none.
bin/install.js is the orchestration layer. Target-specific logic lives in adapters:
bin/adapters/claude.js— Claude auth detection, settings merge, core files mappingbin/adapters/codex.js— Codex auth detection, config.toml merge, core files mappingbin/adapters/openclaw.js— OpenClaw workspace resolution, CLI/config detection, core files mappingbin/lib/ccstatusline.js— Claude status bar (ccstatusline) integrationbin/lib/style-registry.js— Style catalog + repository AGENTS snapshot assemblybin/lib/utils.js— Shared:copyRecursive,rmSafe,deepMergeNew,parseFrontmatter,shouldSkip
skills/run_skill.js is the script-type skill runner:
- Resolve skill via registry → validate
runtimeType=scripted - Acquire target lock (async polling, 30s timeout)
- Spawn child process with the script entry
- Propagate exit code, release lock on exit/signal
Knowledge-type skills are read-only — no script execution, just load SKILL.md content.
---
name: verify-quality # kebab-case, unique across all skills
description: Code quality gate
user-invocable: false # true = explicit command; false = knowledge-only / auto-routed by context
allowed-tools: Bash, Read, Glob # optional, default: Read
argument-hint: <scan-path> # optional
aliases: vq # optional comma-separated aliases
---- Create
skills/<category>/<skill-name>/SKILL.mdwith required frontmatter - For script-type: add exactly one
scripts/<name>.jsentry point - Run
npm run verify:skills— must pass with zero errors - Run
npm test— especiallytest/install-registry.test.js,test/install-generation.test.js,test/run-skill.test.js - Verify no name collision with existing skills
- Exactly one entry in
output-styles/index.jsonmust havedefault: true slugmust be kebab-case, uniquetargetsdefaults to all supported install targets if omitted- Corresponding
.mdfile must exist inoutput-styles/
| Target | Config file | Skill artifacts | Style mechanism |
|---|---|---|---|
| Claude | ~/.claude/CLAUDE.md |
~/.claude/commands/*.md (optional) + ~/.claude/skills/ |
settings.json.outputStyle = slug |
| Codex | ~/.codex/config.toml |
~/.codex/skills/ |
~/.codex/instruction.md (persona + style, via model_instructions_file) |
| Gemini | ~/.gemini/settings.json |
~/.gemini/GEMINI.md + ~/.gemini/commands/*.toml (optional) + ~/.gemini/skills/ |
Global context + TOML command runtime |
| OpenClaw | ~/.openclaw/openclaw.json |
~/.openclaw/skills/ + <workspace>/AGENTS.md + <workspace>/SOUL.md |
SOUL.md persona/style + workspace AGENTS rules |
Backups go to <target-dir>/.code-abyss-backup/ with manifest.json. Uninstall restores from backup.