vibe-coding-cn / chat-vault
tukuaiai/vibe-coding-cn/.github/tools/chat-vault/AGENTS.md
AI Agent 操作手册 - Chat Vault Monorepo
AGENTS.md18k starsChanged 6 months ago
- Reads credentials
What's in it
- AGENTS.md
- 1. Mission & Scope(目标与边界)
- 允许操作
- 禁止操作
- 敏感区域
- 2. Golden Path(推荐执行路径)
- 3. Must-Run Commands(必须执行的命令)
- 环境准备
- 依赖文件
- 功能验证
- 4. Code Change Rules(修改约束)
- 架构原则
- 模块边界
- 依赖添加规则
- 兼容性要求
- 5. Style & Quality(风格与质量)
- 代码风格
- 文档要求
- 错误处理
- 6. Project Map(项目结构速览)
- 关键入口
- 7. Common Pitfalls(常见问题)
- 8. PR / Commit Rules(提交规则)
- Commit Message 格式
- 分支策略
- 9. Documentation Sync Rule(文档同步规则)
- 强制同步
- 不确定时
- 10. Quick Reference(速查)
# AGENTS.md AI Agent 操作手册 - Chat Vault Monorepo --- ## 1. Mission & Scope(目标与边界) ### 允许操作 - 修改 `services/chat-vault/src/` 下的 Python 代码 - 添加新的解析器到 `services/chat-vault/src/parsers/` - 更新文档 (`README.md`, `AGENTS.md`, `docs/`) - 修改配置示例 `.env.example` ### 禁止操作 - **禁止修改** `output/` 目录下的任何文件(数据库、日志) - **禁止修改** `.env` 文件(包含用户敏感配置) - **禁止提交** 整份第三方源码镜像;外部工具应通过系统包管理器、官方仓库或 Git submodule 表示 - **禁止删除** 现有解析器,除非明确要求 ### 敏感区域 | 路径 | 说明 | |------|------| | `services/chat-vault/.env` | 用户配置,不得读取或修改 | | `services/chat-vault/output/` | 运行时数据,不得修改 | | `libs/external/` | 外部依赖入口,不提交 vendored 源码 | | `monitoring/grafana/` | Grafana 配置入口,不提交完整第三方监控工具源码 | --- ## 2. Golden Path(推荐执行路径) ```bash # 1. 进入服务目录 cd services/chat-vault # 2. 首次运行(自动创建 venv 并安装依赖) python src/main.py # 3. 验证功能 python src/main.py --stats # 4. 修改代码后测试 python src/main.py # 同步测试 python src/main.py --search "test" # 搜索测试 # 5. 更新文档(如有变更) # 编辑 README.md, AGENTS.md, docs/schema.md ``` --- ## 3. Must-Run Commands(必须执行的命令) ### 环境准备 ```bash cd services/chat-vault python src/main.py # 首次运行自动安装依赖 ``` ### 依赖文件 - `services/chat-vault/requirements.txt` ``` python-dotenv>=1.0.0 watchdog>=3.0.0 tiktoken>=0.5.0 ``` ### 功能验证 ```bash # 同步一次 python src/main.py # 查看统计 python src/main.py --stats # 监控模式 python src/main.py --watch ``` --- ## 4. Code Change Rules(修改约束) ### 架构原则 - 解析器必须继承 `parsers/base.py` 的 `SessionData` 数据结构 - 新增 CLI 支持需在 `parsers/__init__.py` 中导出 - 配置项通过 `config.py` 的 `CONFIG` 字典访问 ### 模块边界 | 模块 | 职责 | 禁止 | |------|------|------| | `main.py` | CLI 入口、命令分发 | 不含业务逻辑 | | `config.py` | 路径检测、配置加载 | 不含 I/O 操作 | | `storage.py` | SQLite 读写、Token 计数 | 不含解析逻辑 | | `watcher.py` | 文件监控 | 不含存储逻辑 | | `parsers/*.py` | 各 CLI 格式解析 | 不含存储逻辑 | ### 依赖添加规则 - 新依赖必须添加到 `requirements.txt` - 优先使用标准库 - 避免引入大型框架 ### 兼容性要求 - Python 3.8+ 兼容 - 跨平台:Linux / macOS / Windows (WSL) - WSL 路径格式:`\\wsl.localhost\Ubuntu\...` --- ## 5. Style & Quality(风格与质量) ### 代码风格 - 文件头:`#!/usr/bin/env python3` + `# -*- coding: utf-8 -*-` - 缩进:4 空格 - 行宽:建议 100 字符 - 命名:snake_case(函数/变量),PascalCase(类) ### 文档要求 - 每个模块需有 docstring 说明用途 - 公开函数需有参数/返回值说明 - 复杂逻辑需有行内注释 ### 错误处理 - 解析失败记录到日志,不中断流程 - 使用 `logger.py` 的 `get_logger()` 记录 --- ## 6. Project Map(项目结构速览) ``` chat-vault/ ├── services/chat-vault/ # 核心服务 │ ├── src/ │ │ ├── main.py # 入口:CLI 命令分发 │ │ ├── config.py # 配置:路径检测、环境变量 │ │ ├── storage.py # 存储:SQLite + tiktoken │ │ ├── watcher.py # 监控:watchdog 封装 │ │ ├── logger.py # 日志:统一日志配置 │ │ └── parsers/ │ │ ├── __init__.py # 导出所有解析器 │ │ ├── base.py # SessionData 数据结构 │ │ ├── codex.py # Codex CLI 解析 │ │ ├── kiro.py # Kiro CLI 解析 │ │ ├── gemini.py # Gemini CLI 解析 │ │ └── claude.py # Claude CLI 解析 │ ├── docs/ │ │ ├── schema.md # 数据库结构文档 │ │ ├── roadmap.md # 开发路线图 │ │ └── AI_PROMPT.md # AI 助手指南 │ ├── requirements.txt # Python 依赖 │ ├── .env.example # 配置示例 │ ├── start.sh # Linux/macOS 启动脚本 │ └── start.bat # Windows 启动脚本 ├── libs/ # 共享库(预留) │ └── external/ # 外部依赖入口,不提交整份第三方源码 ├── monitoring/ # 监控配置(预留,不提交监控工具源码镜像) ├── scripts/ # 全局脚本 ├── README.md # 项目说明 └── AGENTS.md # 本文件 ``` ### 关键入口 - **CLI 入口**: `services/chat-vault/src/main.py` - **配置加载**: `services/chat-vault/src/config.py` → `CONFIG` 字典 - **数据库**: `services/chat-vault/output/chat_history.db` --- ## 7. Common Pitfalls(常见问题) | 问题 | 原因 | 解决 | |------|------|------| | `ModuleNotFoundError` | 未在 venv 中运行 | 运行 `python src/main.py` 自动创建 venv | | 路径未检测到 | 默认路径不存在 | 在 `.env` 中配置 `CODEX_PATHS` 等 | | WSL 路径失败 | 格式错误 | 使用 `\\wsl.localhost\Ubuntu\...` 格式 | | Token 计数为 0 | tiktoken 未安装 | 检查 `requirements.txt` 是否包含 tiktoken | | 数据库锁定 | 多进程同时写入 | 确保只有一个实例运行 | --- ## 8. PR / Commit Rules(提交规则) ### Commit Message 格式 ``` <type>(<scope>): <description> type: feat|fix|docs|refactor|test|chore scope: chat-vault|parsers|storage|config|docs ``` 示例: ``` feat(parsers): add support for new CLI format fix(storage): handle empty message array docs(readme): update quick start section ``` ### 分支策略 - `main`: 稳定版本 - `dev`: 开发分支 - `feature/*`: 功能分支 --- ## 9. Documentation Sync Rule(文档同步规则) ### 强制同步 以下变更必须同步更新文档: | 变更类型 | 需更新文档 | |----------|-----------| | 新增命令行参数 | README.md, AGENTS.md | | 新增解析器 | README.md (功能特性), AGENTS.md (Project Map) | | 数据库结构变更 | docs/schema.md | | 配置项变更 | README.md (配置说明), .env.example | | 目录结构变更 | README.md, AGENTS.md | ### 不确定时 - 使用 `TODO: 需确认 <具体问题>` 标注 - 不允许猜测或编造 --- ## 10. Quick Reference(速查) ```bash # 同步 python src/main.py # 监控 python src/main.py --watch # 统计 python src/main.py --stats # 搜索 python src/main.py --search "关键词" # 导出 python src/main.py --export json python src/main.py --export csv --source codex # 清理 python src/main.py --prune ```
More agent context in tukuaiai/vibe-coding-cn
72 other files this repository gives its agents, the first 60 shown.
AGENTS.md
- AGENTS.md
- .github/AGENTS.md
- .github/assets/AGENTS.md
- .github/assets/ai-citation/AGENTS.md
- .github/assets/datasets/AGENTS.md
- .github/assets/external-resources/AGENTS.md
- .github/assets/images/AGENTS.md
- .github/assets/templates/AGENTS.md
- .github/docs/AGENTS.md
- .github/docs/getting-started/AGENTS.md
- .github/docs/gongfa/AGENTS.md
- .github/ISSUE_TEMPLATE/AGENTS.md
- .github/metadata/AGENTS.md
- .github/metadata/gongfa/AGENTS.md
- .github/prompts/AGENTS.md
- .github/research/aaif-goose-goose/AGENTS.md
- .github/research/addyosmani-agent-skills/AGENTS.md
- .github/research/affaan-m-ecc/AGENTS.md
- .github/research/AGENTS.md
- .github/research/aider-ai-aider/AGENTS.md
- .github/research/ai-for-developers-awesome-vibe-coding/AGENTS.md
- .github/research/anomalyco-opencode/AGENTS.md
- .github/research/cline-cline/AGENTS.md
- .github/research/continuedev-continue/AGENTS.md
- .github/research/daotin-ai-coding/AGENTS.md
- .github/research/datawhalechina-easy-vibe/AGENTS.md
- .github/research/datawhalechina-vibe-vibe/AGENTS.md
- .github/research/earyantle-vibe-coding-skill/AGENTS.md
- .github/research/facts/AGENTS.md
- .github/research/filipecalegario-awesome-vibe-coding/AGENTS.md
- .github/research/fission-ai-openspec/AGENTS.md
- .github/research/github-spec-kit/AGENTS.md
- .github/research/google-gemini-gemini-cli/AGENTS.md
- .github/research/harness/AGENTS.md
- .github/research/hesreallyhim-awesome-claude-code/AGENTS.md
- .github/research/liyupi-ai-guide/AGENTS.md
- .github/research/luzhenqian-ai-coding-lab/AGENTS.md
- .github/research/mindfold-ai-trellis/AGENTS.md
- .github/research/obra-superpowers/AGENTS.md
- .github/research/openai-agents-js/AGENTS.md
- .github/research/openai-agents-python/AGENTS.md
- .github/research/openai-codex/AGENTS.md
- .github/research/openai-cookbook/AGENTS.md
- .github/research/openai-plugins/AGENTS.md
- .github/research/openai-skills/AGENTS.md
- .github/research/openhands-openhands/AGENTS.md
- .github/research/roocodeinc-roo-code/AGENTS.md
- .github/research/shanraisshan-claude-code-best-practice/AGENTS.md
- .github/research/shouzhengai-cs146s-cn/AGENTS.md
- .github/research/swe-agent-mini-swe-agent/AGENTS.md
- .github/research/tradecatlabs-vibe-coding-cn/AGENTS.md
- .github/research/vibe-cybersecurity-cn/AGENTS.md
- .github/research/vibe-harness-cn/AGENTS.md
- .github/research/vibe-mathing-cn-public/AGENTS.md
- .github/research/walkinglabs-learn-harness-engineering/AGENTS.md
- .github/research/wendy7756-vibe-coding-guide/AGENTS.md
- .github/scripts/AGENTS.md
- .github/scripts/lib/AGENTS.md
- .github/skills/AGENTS.md
- .github/skills/auto-skill/AGENTS.md
Discussion
Talked about elsewhere, linking to tukuaiai/vibe-coding-cn
- Add Vibe Coding CN Skill
GitHub · ComposioHQ/awesome-claude-skills · Mar 23, 2026
- 直接copy?
GitHub · 2025Emma/vibe-coding-cn · 3 comments · Mar 23, 2026
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

