Skip to content

Commit 21cd69b

Browse files
committed
docs: add CLAUDE.md for Claude Code guidance
1 parent 85e8e9d commit 21cd69b

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project
6+
7+
opencode-bell 是 OpenCode CLI 的终端铃声通知插件。监听 4 种事件(`permission.asked``question.asked``session.idle``session.error`),通过输出 BEL 字符(`\x07`)实现通知。零依赖、单文件实现。
8+
9+
隐私设计:不读取消息内容、不执行外部命令、无网络调用,仅在 TTY 终端输出铃声。
10+
11+
## Commands
12+
13+
```bash
14+
npm test # 运行测试(node:test 原生框架)
15+
node -e "import('./index.js')" # 烟雾测试:验证模块可导入
16+
```
17+
18+
无构建步骤,纯 JS ES Module 直接发布。
19+
20+
## Architecture
21+
22+
`index.js` 导出 `OpencodeBellPlugin` 异步工厂函数,返回 `{ event(e) }` 插件对象。核心机制:
23+
24+
- **会话级防抖**:以 `eventType:sessionId` 为 key,1200ms 内同 key 最多响铃一次
25+
- **TTY 守卫**`process.stdout.isTTY` 为 false 时静默跳过
26+
27+
## Publishing
28+
29+
`package.json``files` 字段限制发布为 3 个文件:`index.js``README.md``LICENSE`。用户通过在 `~/.config/opencode/opencode.json` 添加 `"plugin": ["opencode-bell@版本"]` 安装。

0 commit comments

Comments
 (0)