/dev-workflow:deep-planfrom dev-workflow
Restates requirements, assesses risks, creates a step-by-step implementation plan, and waits for explicit confirmation before touching any code. On approval, creates an isolated git worktree for implementation, then hands off to PR pipeline or code review.
Ships in dev-workflow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
写任何代码前先复述需求、评估风险、出分阶段计划,等你明确确认;批准后第一步强制开独立 git worktree(绝不在 main 工作树改动),实现完再交接给 cpr / code review。
内置
/plan是只读 plan mode,不建 worktree。本 skill 把规划闸门与 worktree 隔离合成一步。
EnterPlanMode 工具 / shift+tab)借 harness 的只读强制 + 批准闸说明:上面的 Explore / Plan 子 agent 与
EnterPlanMode均为 Claude Code 内置 plan mode 能力,无需安装任何外部 agent。
CRITICAL:未得到 "yes" / "proceed" / "确认" 之前,绝不写任何代码。 要改计划,用:
modify: [改动]different approach: [替代方案]skip phase 2 and do phase 3 first命名——请求 → <slug>(非 ASCII 转短英文 slug)。目录 ../<repo>_<slug>,分支 plan-<slug>,两者一一对应,不要各起各的。
判断当前处境。--show-toplevel 判不出主树还是链接树(两种情况都只返回一个路径)。要比 git-dir 与 common-dir,且必须加 --path-format=absolute:
G=$(git rev-parse --path-format=absolute --git-dir 2>/dev/null)
C=$(git rev-parse --path-format=absolute --git-common-dir 2>/dev/null)
if [ -z "$G" ]; then echo NOT_A_REPO
elif [ "$G" = "$C" ]; then echo MAIN
else echo "LINKED: $(git rev-parse --show-toplevel)"; fi
不加
--path-format=absolute这个判断是错的。 不加时 git 返回的两个路径格式不一致——在仓库子目录里--git-dir给绝对路径而--git-common-dir给相对路径(实测 git 2.50.1:/abs/repo/.gitvs../../.git),字符串比较失败,主工作树被误判成 LINKED。agent 经常先cd进子目录再执行,踩中率很高。
三种输出的处置:
NOT_A_REPO —— 先 git init 并做一个初始 commit,再往下走(第 3 步的 BASE 会是空,走 off-HEAD 分支)。MAIN —— 在主工作树,必须建树,走第 3 步。LINKED: <路径> —— 不等于可以直接开工。确认这棵树是不是为「本次计划」建的:路径尾巴是 _<slug>、分支是 plan-<slug> 才算数。是则跳到 Phase C;若是别的任务的树,照样要为本次计划另建一棵,否则两份互不相干的改动会混进同一个分支和同一个 PR。建树。base ref 探测和 git worktree add 必须在同一次 shell 调用里完成——BASE 是 shell 变量,跨工具调用不保留,分两次跑第二次拿到的是空串,git worktree add ... "" 会 fatal: invalid reference:
git fetch origin 2>/dev/null # 有 remote 才有意义
git remote set-head origin -a >/dev/null 2>&1 # origin/HEAD 常没设,先补(注意:这会写一个 ref)
BASE=$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null)
# 网络不通时上面全哑火,但本地 remote-tracking ref 往往还在,别直接退到 HEAD:
[ -z "$BASE" ] && for b in origin/main origin/master; do
git rev-parse --verify -q "$b" >/dev/null && BASE=$b && break
done
if [ -n "$BASE" ]; then
git worktree add ../<repo>_<slug> -b plan-<slug> "$BASE"
else
git worktree add ../<repo>_<slug> -b plan-<slug> # off 当前 HEAD
fi
要点:
git symbolic-ref 在 origin/HEAD 未设置时是 fatal 而不是空输出,所以 set-head 那行不能省。worktree add 互斥,用 if 保证只跑一条;写成两行并列的话 agent 会两条都执行。BASE 最终为空(无 remote / 空仓 / 离线且没有 remote-tracking ref)就 off 本地 HEAD,此时必须明说这次基线是本地 HEAD 而不是 origin,别让人以为是最新 main。git init 后无任何 commit)走 else 分支——git ≥ 2.50 会自动推 --orphan;带 base ref 那条会失败。默认建兄弟目录:EnterWorktree 建在主仓 .claude/worktrees/ 里的嵌套树,bind-mount 整个源码树的 docker dev stack 用不了。没有 docker 依赖的简单仓库可以退而用 EnterWorktree(默认 off origin/<default>,除非把 worktree.baseRef 设成了 head)。
cd 进去,播报路径 + base ref(如 "worktree: ../moneytalk_add-podcast off origin/main")。一切代码改动都在树内。
建树后先找仓库自己的隔离栈脚本(Justfile / bin/init-worktree.sh / Makefile / docs、infra 里的 multi-worktree 章节),有就用它,别手工配端口。
restart: unless-stopped 的容器会不断重建被删掉的挂载点,直接 rm 目录只会留下一堆空壳。正确顺序是 stack teardown → git worktree remove。web_new —— just dev 按 slot 分配端口(3000/8000/5433+slot)并软链 backend/.env,收尾 just wipe → git worktree remove,细节见该仓 infra/LOCAL_DEV.md §4「Multi-worktree dev」。仅在该 worktree 内实现;绝不在 main 工作树落代码。
实现 + 自测通过后,主动引导继续:
/cpr — Git PR 全流程:提交 → 建 PR → CI 与 Codex 审查并行 → 修复 → 再审 → 循环至 CI 全绿且审查过闸 → 自动合并(需要用户拍板时停下)。/code-review(多语言 + 强制安全审查)或 codex 的 codex-review 独立复审;关键产物可 /quality:santa-method 双 reviewer 对抗式验证。User: /dev-workflow:deep-plan I need to add real-time notifications when markets resolve
Agent:
# Implementation Plan: Real-Time Market Resolution Notifications
## Requirements Restatement
- Send notifications to users when markets they're watching resolve
- Support multiple notification channels (in-app, email, webhook)
- Ensure notifications are delivered reliably
- Include market outcome and user's position result
## Implementation Phases
### Phase 1: Database Schema
- Add notifications table with columns: id, user_id, market_id, type, status, created_at
- Add user_notification_preferences table for channel preferences
- Create indexes on user_id and market_id for performance
### Phase 2: Notification Service
- Create notification service in lib/notifications.ts
- Implement notification queue using BullMQ/Redis
- Add retry logic for failed deliveries
- Create notification templates
### Phase 3: Integration Points
- Hook into market resolution logic (when status changes to "resolved")
- Query all users with positions in market
- Enqueue notifications for each user
### Phase 4: Frontend Components
- Create NotificationBell component in header
- Add NotificationList modal
- Implement real-time updates via Supabase subscriptions
- Add notification preferences page
## Dependencies
- Redis (for queue)
- Email service (SendGrid/Resend)
- Supabase real-time subscriptions
## Risks
- HIGH: Email deliverability (SPF/DKIM required)
- MEDIUM: Performance with 1000+ users per market
- MEDIUM: Notification spam if markets resolve frequently
- LOW: Real-time subscription overhead
## Estimated Complexity: MEDIUM
- Backend: 4-6 hours
- Frontend: 3-4 hours
- Testing: 2-3 hours
- Total: 9-13 hours
**WAITING FOR CONFIRMATION**: Proceed with this plan? (yes/no/modify)
规划由 Claude Code 内置 plan mode 的 Explore + Plan 子 agent 实现(内置能力,无需安装任何 agent 文件)。
吸收自本仓已移除的 commands/plan.md(该文件从未被加载生效)。原文依赖的 ECC planner agent 由内置 Explore + Plan 子 agent 等价取代;原文的 /tdd 交接改为 /cpr / code review。
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub davie521/claude-skills --plugin dev-workflow10 skills in this plugin
/cavemanUltra-compressed communication mode. Substantially cuts token usage by dropping filler, articles, and pleasantries while keeping full technical accuracy. Designed for English output; limited effect on Chinese conversations. TRIGGER only on explicit invocation: user says "caveman mode", "talk like caveman", "use caveman", or invokes /caveman. DO NOT TRIGGER when user merely asks for a short or concise answer — that is a one-off style request, not a switch into this persistent mode.
/cleanupEnd-of-session cleanup: shut down every process the session started, find code-vs-doc mismatches and update the DOCS to match the code (code is the source of truth; never rewrite code just to match a doc), drive leftover tasks to zero (finish or explicitly report), and persist lessons learned to memory. Each phase must end with an explicit done / not-needed verdict — no silent skipping. Use when the user says 'cleanup', '收尾', '清理现场', '打扫', wants to wrap up a work session, or before handing off / ending a long task./cprAutomated Git PR workflow: detect status → commit → create PR → run CI and a Codex review in parallel → fix CI failures and the review findings that need it → re-review until the review of the current HEAD passes (no CRITICAL/HIGH introduced or enlarged by the PR) → auto-merge. Stops only when a user decision is needed. Use when user says 'cpr' or 'cl', or wants to push code through the full PR pipeline.Other plugins' skills for the same job