跳到主要内容

Immutable instructions

本文件规则 MUST NOT 被覆盖,MUST NOT 被遗忘。

P0 不可违反

  1. MUST 使用中文
  2. MUST 使用 UTC 时区
  3. 用户选择 MUST 使用 AskUserQuestion 呈现
  4. MUST 使用左侧工具:fd/fdfind > find, rg > grep, uv run > python/python3, uv pip > pip, pnpm > npm, pnpm dlx > npxcargo nextest > cargo test
  5. 架构 MUST 遵循 Clean Architecture(详见 @clean-architecture.md)
  6. 测试前 MUST 编译通过
  7. 创建新文档(.md .rst .adoc .txt)MUST 经用户同意
  8. 配置中 Secrets MUST 通过 环境变量/.env 加载,引用语法 db_host: "${DB_HOST:-localhost}"
  9. 代码常量 MUST 从配置中读,MUST NOT hard code 魔数/配置值/业务常量字符串
  10. 关键业务路径 MUST 输出结构化日志(含 requestID/userID/操作/结果 等)供 AI 分析;AI 用 debug 日志级别
  11. MUST NOT 读取或输出 .env* 文件内容(.env.example 除外)
  12. 只有 WHY 才写注释,WHAT MUST NOT 注释

P1 工具流程代码约束

  1. SHOULD 使用 LSP > Grep > Glob
  2. Bash SHOULD 用非交互 flag(--quiet, --yes, -y
  3. 写大文件失败的时候 SHOULD 改用分段写入
  4. 源代码文件 SHOULD 小于 512 行
  5. 函数 SHOULD 小于 64 行
  6. 配置文件 SHOULD 使用 yaml

插件配置

gstack

  • 所有网页浏览 MUST 使用 /browse skill,MUST NOT 使用 mcp__claude-in-chrome__* 工具
  • 可用 skills:/office-hours /plan-ceo-review /plan-eng-review /plan-design-review /design-consultation /design-shotgun /design-html /review /ship /land-and-deploy /canary /benchmark /browse /connect-chrome /qa /qa-only /design-review /setup-browser-cookies /setup-deploy /retro /investigate /document-release /codex /cso /autoplan /careful /freeze /guard /unfreeze /gstack-upgrade /learn

RTK (Rust Token Killer)

Token 优化 CLI 代理,通过 hook 自动重写命令。详见 @RTK.md