Files
JayuCloud/AGENTS.md
T

75 lines
6.5 KiB
Markdown
Raw Normal View History

<!-- gitnexus:start -->
# GitNexus — Code Intelligence
This project is indexed by GitNexus as **JayuCloud** (17949 symbols, 38690 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
> Index stale? Run `node .gitnexus/run.cjs analyze` from the project root — it auto-selects an available runner. No `.gitnexus/run.cjs` yet? `npx gitnexus analyze` (npm 11 crash → `npm i -g gitnexus`; #1939).
## Always Do
- **MUST run impact analysis before editing any symbol.** Before modifying a function, class, or method, run `impact({target: "symbolName", direction: "upstream"})` and report the blast radius (direct callers, affected processes, risk level) to the user.
- **MUST run `detect_changes()` before committing** to verify your changes only affect expected symbols and execution flows. For regression review, compare against the default branch: `detect_changes({scope: "compare", base_ref: "master"})`.
- **MUST warn the user** if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.
- When exploring unfamiliar code, use `query({query: "concept"})` to find execution flows instead of grepping. It returns process-grouped results ranked by relevance.
- When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use `context({name: "symbolName"})`.
## Never Do
- NEVER edit a function, class, or method without first running `impact` on it.
- NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.
- NEVER rename symbols with find-and-replace — use `rename` which understands the call graph.
- NEVER commit changes without running `detect_changes()` to check affected scope.
## Resources
| Resource | Use for |
|----------|---------|
2026-07-13 15:20:34 +08:00
| `gitnexus://repo/JayuCloud/context` | Codebase overview, check index freshness |
| `gitnexus://repo/JayuCloud/clusters` | All functional areas |
| `gitnexus://repo/JayuCloud/processes` | All execution flows |
| `gitnexus://repo/JayuCloud/process/{name}` | Step-by-step execution trace |
## CLI
| Task | Read this skill file |
|------|---------------------|
| Understand architecture / "How does X work?" | `.claude/skills/gitnexus/gitnexus-exploring/SKILL.md` |
| Blast radius / "What breaks if I change X?" | `.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md` |
| Trace bugs / "Why is X failing?" | `.claude/skills/gitnexus/gitnexus-debugging/SKILL.md` |
| Rename / extract / split / refactor | `.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md` |
| Tools, resources, schema reference | `.claude/skills/gitnexus/gitnexus-guide/SKILL.md` |
| Index, status, clean, wiki CLI commands | `.claude/skills/gitnexus/gitnexus-cli/SKILL.md` |
<!-- gitnexus:end -->
2026-05-29 13:30:56 +08:00
## Project Workflow Rules
2026-06-26 09:48:34 +08:00
- 每次任务中发现的问题、原因和处理方式都需要记录下来,并在后续相关任务中回顾,避免重复发生。
- 后端修改如果涉及 SQL,不要修改初始化 SQL;必须新增版本变更 SQL。
- 版本变更 SQL 文件名必须使用中文,体现功能和日期,并且 SQL 内容必须是完整可执行脚本。
2026-07-21 23:02:30 +08:00
- 如果任务涉及新增或修改 SQL,必须在 `scripts/sql/migrations/` 下按 `YYYYMMDD-作用` 创建单独目录分类;git 提交信息必须明确体现 SQL 变更,任务结束回复必须提醒用户执行对应 SQL,并列出迁移目录/文件和执行目的;如果涉及生产版本更新,必须记录生产已执行的 SQL 清单,生产执行并验证通过后将对应 SQL 文件名追加 `_生产已执行` 后缀。
2026-07-06 15:59:03 +08:00
- 如果修改涉及配置、集成、部署或运行说明,必须追加到 `docs/运维配置与集成说明.md` 和 `docs/项目变更记录.md`,不得在 `scripts/` 下新增普通说明文档,除非用户明确要求创建独立专题文档。
2026-06-29 23:26:43 +08:00
- 当前代码、脚本、配置、SQL 和文档已固定为 `0.0.1` 基线;`scripts/sql/init/JayuCloud.sql` 从甲屿云命名迁移后继续作为空库首次初始化入口,仅空库首次初始化使用,后续 SQL、脚本和配置都必须通过版本迭代文件新增或调整。
2026-07-06 15:59:03 +08:00
- 后续涉及脚本、配置、SQL 或项目文档的任务,必须优先阅读 `docs/项目文档索引.md` 和 `scripts/0.0.1版本基线与后续迭代规则_20260628.md`,并把任务记录追加到 `docs/项目变更记录.md`。
2026-06-24 10:39:04 +08:00
- 每次修改代码或者完成任务后,必须整理本次任务相关改动并创建 git 提交;提交信息必须使用中文。
2026-05-29 13:30:56 +08:00
## Browser MCP Preference
- For any browser-related operation, including opening, navigating, clicking, typing, inspecting pages/devtools, taking screenshots, testing pages, or automating local/remote web targets, use the `edgedev` MCP server first.
- Do not use other browser automation providers such as Browser, browser-use, Chrome, Playwright MCP, or generic web browsing for browser operations unless `edgedev` is unavailable or the user explicitly requests a different browser/MCP in that turn.
2026-07-06 15:59:03 +08:00
## Documentation Consolidation Rules
- `docs/` 是唯一项目文档入口;`docx/` 不再保留,`scripts/` 只保留脚本、SQL 和必要执行文件。
- 后续普通文档更新必须追加到 `docs/` 下现有权威文档:设计写入 `项目总设计文档.md`,配置/集成写入 `运维配置与集成说明.md`,任务变更写入 `项目变更记录.md`,测试验收写入 `测试验收与上线记录.md`,交接状态写入 `交接与当前状态.md`。
- 新增独立文档前必须先确认现有权威文档无法承载该内容;敏感配置只记录配置项和位置,不记录 token、密码、密钥明文。
2026-07-14 17:33:05 +08:00
## External Memory Rules
2026-07-20 16:51:55 +08:00
- 每次开始任务前,先阅读 `AGENTS.md` 和 `memory/context.md`,并按全局规则读取 `C:\Users\21616\.codex\rules\ERROR_MEMORY_INDEX.md`;只按任务关键词检索 `ERROR_MEMORY.md` 的相关条目,不默认整文件读取。
2026-07-14 17:33:05 +08:00
- 长任务推进中维护 `memory/progress.md`,只记录已完成事项、下一步、当前阻塞点和最近一次重要操作结果。
- 遇到可复用的踩坑、失败方案或已知风险时,更新 `memory/bugs.md`,写清问题、原因、处理方式和以后如何避免。
- 外置记忆保持轻量:稳定信息放 `memory/context.md`,当前状态放 `memory/progress.md`,风险和踩坑放 `memory/bugs.md`;不要复制已有权威文档的长内容。
- 提交前只暂存并提交本次任务相关文件,使用 `git diff --cached --name-only` 或等效命令确认没有混入无关文件或用户改动。
- 每次完成任务后创建 git 提交,提交信息使用中文。