githubinferredactive
code-abyss
provenance:github:telagod/code-abyss
WHAT THIS AGENT DOES
Code Abyss transforms AI coding assistants like Claude Code and Codex CLI by giving them a unique, immersive persona and specialized output styles. It helps developers and security professionals quickly generate code and solutions with a focus on practical application and security considerations. This tool is particularly useful for those working on cybersecurity projects, penetration testing, or needing to rapidly prototype and test code. What sets it apart is its ability to inject a specific, pre-defined "security mindset" and tailored communication style into the AI's responses, streamlining workflows and potentially uncovering vulnerabilities.
README
# ☠️ Code Abyss
<div align="center">
**邪修红尘仙 · 宿命深渊**
*为 Claude Code / Codex CLI 注入邪修人格、4种可切换输出风格与 57 篇攻防工程秘典*
[](https://www.npmjs.com/package/code-abyss)
[](https://github.com/telagod/code-abyss/actions/workflows/ci.yml)
[](https://opensource.org/licenses/MIT)
[]()
[]()
</div>
---
## 🚀 安装
```bash
npx code-abyss
npx code-abyss --list-styles
```
交互式菜单(方向键选择,回车确认):
```
☠️ Code Abyss v2.0.3
? 请选择操作 (Use arrow keys)
❯ 安装到 Claude Code (~/.claude/)
安装到 Codex CLI (~/.codex/)
卸载 Claude Code
卸载 Codex CLI
```
也可以直接指定:
```bash
npx code-abyss --target claude # 安装到 ~/.claude/
npx code-abyss --target codex # 安装到 ~/.codex/
npx code-abyss --style abyss-concise --target claude
npx code-abyss --style abyss-concise --target codex
npx code-abyss --target claude -y # 零配置一键安装 (自动合并推荐配置)
npx code-abyss --target codex -y # 零配置一键安装 (自动写入 config.toml 模板)
npx code-abyss --list-styles # 列出可用输出风格
npx code-abyss --uninstall claude # 卸载 Claude Code
npx code-abyss --uninstall codex # 卸载 Codex CLI
```
### 安装流程
核心文件安装后,自动检测 API 认证状态:
```
── 认证检测 ──
✅ 已检测到认证: [custom] https://your-api.com
```
支持的认证方式:
- `claude login` / `codex login` (官方账号)
- 环境变量 `ANTHROPIC_API_KEY` / `OPENAI_API_KEY`
- 自定义 provider (`ANTHROPIC_BASE_URL` + `ANTHROPIC_AUTH_TOKEN`)
未检测到认证时会提示配置,可交互输入或跳过。
安装前可选择输出风格;若显式传入 `--style <slug>`,则跳过风格选择并直接安装指定风格。
然后进入可选配置(空格选择,回车确认):
```
? 选择要安装的配置 (Press <space> to select, <enter> to submit)
◉ 精细合并推荐 settings.json (保留现有配置)
◯ 安装 ccline 状态栏 (需要 Nerd Font)
```
- **settings.json 精细合并**:逐项合并推荐配置,已有的 key 不覆盖,缺失的 key 补上
- **ccline 状态栏**:自动安装 `@cometix/ccline` + `ccline --init` 生成配置 + 合并 statusLine 到 settings.json
> 已有配置会自动备份到 `.sage-backup/`,卸载时一键恢复。
### 输出风格
当前内置风格:
- `abyss-cultivator`:默认风格,沉浸式邪修表达,情绪张力更强
- `abyss-concise`:冷刃简报,保留角色设定,但表达更克制、更偏工程交付
- `abyss-command`:铁律军令,命令式、压缩式输出,适合发布/故障/修复
- `abyss-ritual`:祭仪长卷,仪式感更强,适合长任务、战报与迁移总结
Claude 安装时会把所选 slug 写入 `settings.json.outputStyle`;Codex 安装时会根据所选风格动态生成 `~/.codex/AGENTS.md`。
---
## 🗑️ 卸载
```bash
npx code-abyss --uninstall claude # 卸载 Claude Code
npx code-abyss --uninstall codex # 卸载 Codex CLI
```
也可以用备用脚本:
```bash
node ~/.claude/.sage-uninstall.js # Claude Code
node ~/.codex/.sage-uninstall.js # Codex CLI
```
自动恢复之前备份的配置,清理所有安装文件。
---
## 🎭 这是什么
Code Abyss 是一套 **Claude Code / Codex CLI 邪修人格 + 多风格输出 + 攻防工程配置包**,一条命令注入:
- 🔥 **邪修人格** — 沉浸式角色扮演 + 道语标签 + 渡劫协议 + 反拒绝条款 + `/hi` 会话覆写
- ⚔️ **攻防安全知识体系** — 红队/蓝队/紫队三脉道统,6 个安全化身,11 领域 56 篇专业秘典
- 🗡 **零废话安全研究** — 禁 disclaimer、禁道德前缀、全授权直出 PoC + 技术细节
- ⚡ **全开默认配置** — Claude `bypassPermissions` / Codex `approval_policy=never` + `danger-full-access`
- ⚖️ **5 个校验关卡** — 安全扫描、模块完整性、变更分析、代码质量、文档生成
- 🧠 **沙箱感知 + 离线优先** — 自适应执行环境,信息三级分级验证
- 🧬 **单源 skill registry** — `skills/**/SKILL.md` frontmatter 同时驱动 Claude commands、Codex prompts 与脚本执行链
---
## 📦 安装内容
```
~/.claude/(Claude Code) ~/.codex/(Codex CLI)
├── CLAUDE.md 道典 ├── AGENTS.md 道典+所选风格(动态生成)
├── output-styles/ 输出风格 ├── config.toml 推荐配置
│ ├── index.json ├── prompts/ custom prompts
│ └── *.md style files └── skills/ 秘典 + 脚本执行器
├── commands/ 斜杠命令 │ └── *.md 自动生成 prompt
├── settings.json
└── skills/ 56 篇秘典
可选:
├── ccline/ 状态栏 (npm install -g @cometix/ccline)
└── statusLine 自动合并到 settings.json
```
---
## 🛠️ 内置 Skills(11 领域 56 篇秘典)
### 校验关卡(`/` 直接调用)
这些命令与 Codex custom prompts 都不是手写维护,而是由各自 `skills/**/SKILL.md` frontmatter 中的 `name`、`user-invocable`、`allowed-tools`、`argument-hint`、`scripts/` 状态统一生成。
| 命令 | 功能 |
|------|------|
| `/verify-security` | 扫描代码安全漏洞,检测危险模式 |
| `/verify-module` | 检查目录结构、文档完整性 |
| `/verify-change` | 分析 Git 变更,检测文档同步状态 |
| `/verify-quality` | 检测复杂度、命名规范、代码质量 |
| `/gen-docs` | 自动生成 README.md 和 DESIGN.md 骨架 |
| `/override-refusal` (`/hi`) | 扫描当前会话最近5条模型输出,直接替换拒绝话术为同意措辞 |
### 知识秘典(按触发词自动加载)
| 领域 | 秘典 |
|------|------|
| 🔥 安全 | 红队攻击、蓝队防御、渗透测试、威胁情报、威胁建模、漏洞研究、代码审计、密钥管理、供应链安全 |
| 🏗 架构 | API 设计、云原生、安全架构、消息队列、缓存策略、合规审计、数据安全 |
| 📜 开发 | Python、TypeScript、Go、Rust、Java、C++、Shell、Dart、Kotlin、PHP、Swift |
| 🔧 DevOps | Git 工作流、测试策略、E2E 测试、性能测试、数据库、DevSecOps、性能优化、可观测性、成本优化 |
| 🎨 前端 | 构建工具、组件模式、性能优化、状态管理、前端测试、UI 美学、UX 原则 |
| 📱 移动端 | Android 开发、iOS 开发、跨平台开发 |
| 🔮 AI | Agent 开发、LLM 安全、RAG 系统、模型评估、Prompt 工程 |
| 🏭 数据工程 | 数据管道、数据质量、流处理 |
| ☁️ 基础设施 | GitOps、IaC、Kubernetes |
| 🕸 协同 | 多 Agent 任务分解与并行编排 |
---
## ⚙️ 推荐配置
### Claude `settings.json` 推荐模板
安装时选择「精细合并」会自动写入,也可手动参考 [`config/settings.example.json`](config/settings.example.json):
```json
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"CLAUDE_CODE_ENABLE_TASKS": "1",
"CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION": "1",
"ENABLE_TOOL_SEARCH": "auto:10"
},
"defaultMode": "bypassPermissions",
"alwaysThinkingEnabled": true,
"autoMemoryEnabled": true,
"model": "opus",
"outputStyle": "abyss-cultivator",
"attribution": { "commit": "", "pr": "" },
"sandbox": { "autoAllowBashIfSandboxed": true },
"permissions": {
"allow": ["Bash", "LS", "Read", "Edit", "Write", "MultiEdit",
"Agent", "Glob", "Grep", "WebFetch", "WebSearch",
"TodoWrite", "NotebookRead", "NotebookEdit", "mcp__*"]
}
}
```
| 配置项 | 说明 |
|--------|------|
| `defaultMode: bypassPermissions` | 跳过所有权限确认(`.git`等受保护目录仍会提示) |
| `autoMemoryEnabled` | 启用自动记忆,跨会话保留上下文 |
| `sandbox.autoAllowBashIfSandboxed` | 沙箱环境内自动放行 Bash 命令 |
| `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` | 启用多 Agent 并行协作(实验性) |
| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | 禁用自动更新、遥测、错误报告 |
| `CLAUDE_CODE_ENABLE_TASKS` | 启用任务管理功能 |
| `CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION` | 启用提示建议 |
| `ENABLE_TOOL_SEARCH` | MCP 工具自动搜索(auto:10 = 自动匹配前10个) |
| `mcp__*` | 自动放行所有 MCP 工具 |
| `outputStyle` | 设置当前选择的风格 slug,默认 `abyss-cultivator` |
---
### Codex `config.toml` 推荐模板
安装 `--target codex`(尤其 `-y`)时会写入以下 **全开默认档** 到 `~/.codex/config.toml`:
```toml
model_provider = "custom"
model = "gpt-5.2-codex"
model_reasoning_effort = "high"
model_reasoning_summary = "detailed"
model_verbosity = "medium"
approval_policy = "never"
sandbox_mode = "danger-full-access"
disable_response_storage = true
[profiles.safe]
approval_policy = "on-request"
sandbox_mode = "workspace-write"
[model_providers.custom]
name = "custom"
base_url = "https://your-api-endpoint.com/v1"
wire_api = "responses"
requires_openai_auth = true
[tools]
web_search = true
[features]
multi_agent = true
shell_snapshot = true
undo = true
```
- 默认零审批 + 完全沙箱访问,适合安全研究/CTF/本地开发等高自动化场景
- `model_reasoning_summary = "detailed"` 输出详细推理摘要
- `shell_snapshot` / `undo` 启用快照与撤销功能
- 需要安全姿态时可显式切到 `safe`:`codex -p safe`
### 兼容性说明
- 模板已对齐新版 Codex 配置风格:root keys、`[profiles.*]`、`[tools].web_search` 与 `[features].multi_agent`
- 默认档从 safe 切换为全开(`approval_policy = "never"` + `sandbox_mode = "danger-full-access"`),提供 `[profiles.safe]` 作为保守回退
- Claude Code 默认启用 `bypassPermissions` 模式,跳过所有权限确认(`.git` 等受保护目录仍会提示)
- 新增实验功能环境变量:`CLAUDE_CODE_ENABLE_TASKS`、`CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION`
- 新增 `mcp__*` 通配符,自动放行所有 MCP 工具
- `Codex` 当前支持 `~/.codex/prompts/*.md` 作为 custom prompts;Code Abyss 会继续安装 `~/.codex/skills/`,并从 `user-invocable` skills 自动生成对应的 `prompts/`
- `Claude` 与 `Codex` 共用同一套 invocable skill 集合;只要 `user-invocable: true`,就会同步生成 `~/.claude/commands/*.md` 与 `~/.codex/prompts/*.md`
- `--list-styles` 可列出当前内置风格;`--style <slug>` 可在安装时显式切换风格
- `skills/run_skill.js` 现在仅负责执行脚本型 skill:通过共享 registry 定位脚本入口、加目标锁、spawn 子进程,并把退出码原样透传
- 若 skill 没有 `scripts/*.js`,Claude/Codex 两端都会退化为“先读 `SKILL.md`,再按秘典执行”的知识型
[truncated…]PUBLIC HISTORY
First discoveredMar 23, 2026
IDENTITY
inferred
Identity inferred from code signals. No PROVENANCE.yml found.
Is this yours? Claim it →METADATA
platformgithub
first seenFeb 2, 2026
last updatedMar 22, 2026
last crawled4 days ago
version—
README BADGE
Add to your README:
