ClawSkills logoClawSkills

ByteRover

使用 ByteRover 上下文树管理项目知识。提供两种操作:查询(检索知识)和整理(存储知识)。当用户请求时调用

介绍

# ByteRover Context Tree

一个跨会话持久化的项目级知识库。使用它可以避免重复发现模式、约定和决策。

## 为什么使用 ByteRover

- **先行查询**:在实施之前,获取有关模式、约定和过去决策的现有知识 - **事后梳理**:捕获洞察、决策和 Bug 修复,以便未来的会话能够基于信息开始

## 快速参考

| 命令 | 何时使用 | 示例 | |---------|------|---------| | `brv query "question"` | 开始工作之前 | `brv query "How is auth implemented?"` | | `brv curate "context" -f file` | 完成工作之后 | `brv curate "JWT 24h expiry" -f auth.ts` | | `brv status` | 检查先决条件 | `brv status` |

## 何时使用

当你需要理解某些内容时,请**查询**: - “在此代码库中 X 是如何工作的?” - “Y 存在哪些模式?” - “Z 是否有约定?”

当你学到或创建了有价值的内容时,请**梳理**: - 使用特定模式实现了一个功能 - 修复了一个 Bug 并找到了根本原因 - 做出了架构决策

## 梳理质量

上下文必须是**具体**且**可执行**的:

```bash # Good - specific, explains where and why brv curate "Auth uses JWT 24h expiry, tokens in httpOnly cookies" -f src/auth.ts

# Bad - too vague brv curate "Fixed auth" ```

**注意:**上下文参数必须位于 `-f` 标志之前。最多 5 个文件。

## 最佳实践

1. **拆分大型上下文** - 对于复杂的主题,运行多个 `brv curate` 命令,而不是一个巨大的上下文。较小的块更容易检索和更新。

2. **让 ByteRover 读取文件** - 在梳理之前不要自己读取文件。使用 `-f` 标志让 ByteRover 直接读取它们: ```bash # Good - ByteRover reads the files brv curate "Auth implementation details" -f src/auth.ts -f src/middleware/jwt.ts

# Wasteful - reading files twice # [agent reads files] then brv curate "..." -f same-files ```

3. **查询要具体** - 查询会阻塞你的工作流。使用精确的问题以获得更快、更相关的结果: ```bash # Good - specific brv query "What validation library is used for API request schemas?"

# Bad - vague, slow brv query "How is validation done?" ```

4. **标记过时的上下文** - 在梳理替换现有知识的更新时,明确告知 ByteRover 进行清理: ```bash brv curate "OUTDATED: Previous auth used sessions. NEW: Now uses JWT with refresh tokens. Clean up old session-based auth context." -f src/auth.ts ```

5. **指定结构预期** - 指导 ByteRover 如何组织知识: ```bash # Specify topics/domains brv curate "Create separate topics for: 1) JWT validation, 2) refresh token flow, 3) logout handling" -f src/auth.ts

# Specify detail level brv curate "Document the error handling patterns in detail (at least 30 lines covering all error types)" -f src/errors/ ```

## 先决条件

首先运行 `brv status`。如果发生错误,Agent 无法修复它们——指示用户在其 brv 终端中采取措施。有关详细信息,请参阅 [TROUBLESHOOTING.md](TROUBLESHOOTING.md)。

---

**另请参阅:** 有关详细模式和示例,请参阅 [WORKFLOWS.md](WORKFLOWS.md);有关错误处理,请参阅 [TROUBLESHOOTING.md](TROUBLESHOOTING.md)

更多产品