Context Preserver by daffy0208/ai-dev-standards
npx skills add https://github.com/daffy0208/ai-dev-standards --skill 'Context Preserver'永不丢失你的位置。5分钟内恢复工作。消除“我刚才在做什么?”的时刻。
ADHD大脑具有高上下文切换成本和有限的工作记忆。每次中断都意味着需要15-30分钟来“重新进入状态”。解决方案:自动捕获和恢复心理状态,让你能在5分钟内恢复工作。
关键洞察: 保存上下文的行为具有治疗作用——它发出“我可以安全地停止”的信号。
问题: 休息后,需要花费15-30分钟来回忆你刚才在做什么 结果: 生产力损失、挫败感、避免休息
问题: 害怕丢失位置导致无法进行必要的休息 结果: 倦怠、健康问题、质量下降
问题: 返回工作时完全不知道刚才在做什么 结果: 忙乱、重新开始、浪费时间
文件上下文:
心理状态:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
时间上下文:
[15:30] 自动保存触发
上下文已保存:
- 文件:src/components/login.tsx:42
- 函数:handleSubmit()
- 状态:正在添加API调用
- 下一步:401错误处理
- 工作时间:45分钟
✅ 已保存到 .adhd/context.json
✅ 已创建微提交(WIP)
# 你运行:./save-context.sh --break lunch
午餐休息的上下文已保存:
- 当前任务:实现密码重置
- 进度:70%完成
- 文件:src/auth/reset.ts:67
- 下一步:测试邮件发送
- 恢复命令已就绪:./resume.sh
✅ 可以安全休息了!
[会话结束]
正在保存你的上下文:
- 已保存当前任务
- 已创建WIP提交
- 已记录接下来3个步骤
- 已记录会话进度
随时恢复:只需开始新的Claude会话
上下文将自动加载
[检测到10分钟无活动]
看起来你被打断了!
自动保存的上下文:
- 最后活动:10分钟前
- 正在处理:仪表板布局
- 文件:src/pages/dashboard.tsx:125
- 下一步:添加用户统计小部件
当你返回时:上下文已就绪可恢复
{
"timestamp": "2025-10-22T15:30:00Z",
"session": {
"started": "2025-10-22T14:00:00Z",
"duration_minutes": 90,
"breaks_taken": 1,
"focus_sessions": 3
},
"files": {
"current": {
"path": "src/components/login.tsx",
"line": 42,
"column": 12,
"function": "handleSubmit",
"content_preview": "async function handleSubmit(e: FormEvent) {"
},
"related": ["src/api/auth.ts", "src/types/user.ts"]
},
"mental_state": {
"doing": "正在向 /auth/login 端点添加API调用",
"just_finished": "已添加电子邮件验证",
"next_steps": [
"向 /auth/login 添加fetch调用",
"处理401/500错误",
"向按钮添加加载状态"
],
"blockers": ["需要检查API错误格式"],
"notes": "根据团队标准使用fetch(非axios)"
},
"environment": {
"branch": "feature/auth-flow",
"uncommitted_changes": true,
"dev_server_running": true,
"last_command": "npm run dev"
},
"progress": {
"current_task": "构建身份验证流程",
"phase": "阶段2:API集成",
"percent_complete": 60,
"estimated_remaining": "45分钟"
}
}
# 你运行:./resume.sh
╔══════════════════════════════════════╗
║ 恢复工作会话 ║
║ 上次保存:12:15 PM(1小时前) ║
╚══════════════════════════════════════╝
📂 正在恢复上下文...
✅ 已打开:src/components/login.tsx
✅ 光标定位:第42行
✅ 开发服务器已启动
✅ Git分支:feature/auth-flow
💭 你刚才在:
- 向 /auth/login 添加API调用
- 刚刚完成:电子邮件验证
- 下一步:处理401/500错误
📊 进度:60%完成
⏱️ 预计剩余:45分钟
🎯 下一个微任务:添加fetch调用(15分钟)
[在VS Code中打开文件到确切行]
[启动开发服务器]
[显示心理状态笔记]
✅ 可以开始编码了!恢复时间:4分钟
当你开始新的Claude会话时:
你:[开始新会话]
Claude:欢迎回来!我看到你刚才在处理身份验证流程。
让我帮你回顾一下:
📍 最后位置:
文件:src/components/login.tsx:42
函数:handleSubmit()
💭 心理状态(来自1小时前):
- 你正在向 /auth/login 添加API调用
- 电子邮件验证已完成 ✅
- 下一步:处理401/500错误
📊 进度:60%完成(阶段2/3)
🎯 快速选项:
A) 从上次中断处恢复(添加fetch调用)
B) 查看完整上下文(详细笔记)
C) 开始新任务
你想做什么?
每30分钟,Claude会询问:
[快速上下文检查 - 1分钟]
为了帮助你稍后恢复:
1. 你现在正在做什么?
> 正在添加密码重置功能
2. 下一个小步骤是什么?
> 本地测试邮件发送
3. 有任何障碍或问题吗?
> 需要配置SendGrid API密钥
✅ 已保存!这将帮助未来的你。
## 心理状态笔记(自动保存)
15:00 - 开始密码重置功能
15:15 - 生成重置令牌,存储在数据库中
15:30 - 现在正在构建邮件模板
15:35 - 在想应该使用SendGrid还是Postmark
15:40 - 决定使用SendGrid(已有账户)
15:45 - 已配置API密钥,正在测试发送...
[休息]
恢复时的想法:
- 刚才正要测试邮件发送
- SendGrid已配置,密钥在.env中
- 下一步:从表单触发重置邮件
## 面包屑路径(自动生成)
14:00 ✅ 创建了reset-password.tsx
14:15 ✅ 添加了带电子邮件输入的表单
14:30 ✅ 连接到 /api/reset-password
14:45 ✅ 生成了重置令牌
15:00 ✅ 将令牌存储在数据库中
15:15 🔄 正在构建邮件模板 ← 你在这里
15:30 ⬜ 测试邮件发送
15:45 ⬜ 添加重置确认页面
你进展顺利!🎉
[你已有45分钟未保存上下文]
⏸️ 准备休息了吗?
快速保存检查清单:
- [ ] 提交当前工作(WIP也可以!)
- [ ] 写下下一步(一句话)
- [ ] 记录任何障碍
- [ ] 关闭不需要的标签页(减少混乱)
花费2分钟,稍后节省20分钟!
[现在保存上下文] [15分钟后提醒我] [我不休息]
[17:00] 一天即将结束!
🌙 让我们整理一下,以便明天轻松开始:
1. 当前进度:
构建了身份验证流程
进度:75%完成
状态:运行良好,需要测试
2. 明天的第一个任务:
→ 测试密码重置流程(30分钟)
→ 文件:src/auth/reset.ts
→ 应该很快!
3. 明天的障碍:
没有!准备就绪。
4. 今天的成就:
✅ 完成了登录表单
✅ 添加了验证
✅ 连接到API
✅ 修复了bug #234
5. 心理转储:
[还有其他需要记住的吗?]
> 记得检查邮件错误处理
✅ 上下文已保存!明天的你会感谢你。🙏
[结束一天] [继续工作]
每次上下文保存都会创建一个WIP提交:
# 每15分钟自动运行
git add .
git commit -m "WIP: $(cat .adhd/context.json | jq -r '.mental_state.doing') [15:30]"
# 示例提交:
git commit -m "WIP: 正在向登录端点添加API调用 [15:30]"
git commit -m "WIP: 正在测试密码重置流程 [15:45]"
git commit -m "暂停:即将添加错误处理 [16:00]"
# 查看你刚才在做什么
git log -1 --pretty=%B
# 输出:
WIP: 正在测试密码重置流程 [15:45]
# 上下文笔记:
- 文件:src/auth/reset.ts:67
- 下一步:为重置失败添加错误提示
- 障碍:无
[14:45] 15分钟后有会议
正在触发自动保存:
- 当前工作已提交
- 上下文快照已创建
- 恢复脚本已生成
会议后:运行 ./resume.sh
预计恢复时间:5分钟
你:“生产环境有紧急bug,需要切换”
Claude:没问题!让我先保存你的上下文。
✅ 已保存:身份验证流程工作
✅ 已暂存:未提交的更改
✅ 已切换:到主分支
处理bug,之后我会帮你恢复。
恢复命令:./resume-auth-work.sh
[你已浏览文档20分钟]
💭 温和提醒:
你刚才在处理:密码重置表单
当前文件:src/auth/reset.tsx:45
下一步:添加电子邮件输入字段(5分钟)
研究是好的,但也许是时候应用了?
[恢复编码] [继续研究] [休息]
# 与队友共享上下文
./export-context.sh
已生成:context-snapshot.md
将此发送给队友进行配对:
- 你正在处理什么
- 当前进度
- 你需要什么帮助
- 确切的文件位置
# 查看过去的上下文
./context-history.sh
最近的工作会话:
1. 2025-10-22 14:00 - 身份验证流程(90分钟)✅ 已完成
2. 2025-10-22 10:30 - 仪表板UI(2小时)🔄 进行中
3. 2025-10-21 15:00 - Bug修复 #234(45分钟)✅ 已完成
[加载上下文] [删除] [归档]
[开始新会话]
Claude:我注意到你经常处理:
- 身份验证(70%的时间)
- 仪表板UI(20%)
- Bug修复(10%)
你想:
A) 恢复身份验证流程(从上次中断处)
B) 继续仪表板工作(60%完成)
C) 检查开放的bug
D) 开始新任务
根据你的模式,身份验证流程最有可能。
[会话开始]
自动保存间隔:每15分钟
休息提醒:每60分钟
上下文快照:按需
[会话结束]
最终保存包括:
- 总专注时间
- 完成的任务
- 取得的进展
- 明天的起点
项目A → 项目B
自动暂存项目A:
- 提交WIP
- 保存上下文
- 关闭相关标签页
加载项目B:
- 恢复最后上下文
- 打开相关文件
- 显示下一个任务
切换时间:< 5分钟
结对前:
- 导出当前上下文
- 与伙伴共享
- 他们能准确看到你在做什么
结对后:
- 用做出的决定更新上下文
- 记录下一步
- 轻松单独恢复
cd your-project
mkdir .adhd
cp ~/ai-dev-standards/TEMPLATES/adhd/scripts/* ./
chmod +x .adhd/*.sh
# 已安装的脚本:
# - save-context.sh(手动保存)
# - resume.sh(快速恢复)
# - context-history.sh(查看历史)
# - export-context.sh(与团队共享)
# 早晨:单命令启动
./resume.sh
# 工作期间:每15分钟自动保存
# (在后台运行)
# 休息前:快速保存
./save-context.sh --break lunch
# 休息后:单命令恢复
./resume.sh
# 一天结束时:下午5点自动提示
# (自动保存)
不好: 期望自己手动写笔记 原因: ADHD大脑不会持续这样做 好: 每15分钟自动保存
不好: 写详细的状态报告 原因: 浪费时间,不会被维护 好: 意识流快速笔记
不好: 覆盖同一个上下文文件 原因: 丢失历史,无法回溯 好: 带时间戳的历史,可以浏览过去的上下文
当你很好地使用此技能时:
保存你的位置。消除焦虑。5分钟内恢复。 💾
每周安装
0
仓库
GitHub星标
18
首次出现
1970年1月1日
安全审计
Never lose your place. Resume in 5 minutes. Eliminate "Where was I?" moments.
ADHD brains have high context-switching costs and limited working memory. Every interruption means 15-30 minutes of "getting back into it." The solution: Automatically capture and restore mental state so you can resume work in under 5 minutes.
Key Insight: The act of saving context is therapeutic - it signals "I can stop safely."
Issue: After breaks, spend 15-30 min remembering what you were doing Result: Lost productivity, frustration, avoidance of breaks
###Problem 2: Working Memory Limits Issue: Can't hold complex state in mind Result: Constant re-reading code, forgetting next steps
Issue: Fear of losing place prevents taking needed breaks Result: Burnout, health issues, reduced quality
Issue: Return to work with no idea what you were doing Result: Thrashing, starting over, wasted time
File Context:
Mental State:
Environment:
Time Context:
[15:30] Auto-save triggered
Context saved:
- File: src/components/login.tsx:42
- Function: handleSubmit()
- Status: Adding API call
- Next: Error handling for 401
- Time working: 45 min
✅ Saved to .adhd/context.json
✅ Micro-commit created (WIP)
# You run: ./save-context.sh --break lunch
Context saved for lunch break:
- Current task: Implementing password reset
- Progress: 70% complete
- File: src/auth/reset.ts:67
- Next step: Test email delivery
- Resume command ready: ./resume.sh
✅ Safe to take break!
[Session ending]
Preserving your context:
- Saved current task
- Created WIP commit
- Noted next 3 steps
- Logged session progress
Resume anytime: Just start new Claude session
Context will load automatically
[No activity detected for 10 min]
Looks like you got interrupted!
Auto-saved context:
- Last active: 10 min ago
- Working on: Dashboard layout
- File: src/pages/dashboard.tsx:125
- Next: Add user stats widget
When you return: Context ready to resume
{
"timestamp": "2025-10-22T15:30:00Z",
"session": {
"started": "2025-10-22T14:00:00Z",
"duration_minutes": 90,
"breaks_taken": 1,
"focus_sessions": 3
},
"files": {
"current": {
"path": "src/components/login.tsx",
"line": 42,
"column": 12,
"function": "handleSubmit",
"content_preview": "async function handleSubmit(e: FormEvent) {"
},
"related": ["src/api/auth.ts", "src/types/user.ts"]
},
"mental_state": {
"doing": "Adding API call to /auth/login endpoint",
"just_finished": "Added email validation",
"next_steps": [
"Add fetch call to /auth/login",
"Handle 401/500 errors",
"Add loading state to button"
],
"blockers": ["Need to check API error format"],
"notes": "Using fetch (not axios) per team standard"
},
"environment": {
"branch": "feature/auth-flow",
"uncommitted_changes": true,
"dev_server_running": true,
"last_command": "npm run dev"
},
"progress": {
"current_task": "Build authentication flow",
"phase": "Phase 2: API Integration",
"percent_complete": 60,
"estimated_remaining": "45 minutes"
}
}
# You run: ./resume.sh
╔══════════════════════════════════════╗
║ Resuming Work Session ║
║ Last saved: 12:15 PM (1 hour ago) ║
╚══════════════════════════════════════╝
📂 Restoring context...
✅ Opened: src/components/login.tsx
✅ Cursor positioned: Line 42
✅ Dev server started
✅ Git branch: feature/auth-flow
💭 You were:
- Adding API call to /auth/login
- Just finished: Email validation
- Next: Handle 401/500 errors
📊 Progress: 60% complete
⏱️ Estimated remaining: 45 minutes
🎯 Next micro-task: Add fetch call (15 min)
[Opens file at exact line in VS Code]
[Starts dev server]
[Shows mental state notes]
✅ Ready to code! Resume time: 4 minutes
When you start new Claude session:
You: [start new session]
Claude: Welcome back! I see you were working on authentication flow.
Let me catch you up:
📍 Last Location:
File: src/components/login.tsx:42
Function: handleSubmit()
💭 Mental State (from 1 hour ago):
- You were adding API call to /auth/login
- Email validation is done ✅
- Next: Handle 401/500 errors
📊 Progress: 60% complete (Phase 2/3)
🎯 Quick options:
A) Resume where you left off (add fetch call)
B) See full context (detailed notes)
C) Start something new
What would you like to do?
Every 30 minutes, Claude asks:
[Quick context check - 1 minute]
To help you resume later:
1. What are you working on right now?
> Adding password reset functionality
2. What's the next small step?
> Test email delivery locally
3. Any blockers or questions?
> Need to configure SendGrid API key
✅ Saved! This will help Future You.
## Mental State Notes (Auto-saved)
15:00 - Started password reset feature
15:15 - Generated reset token, stored in DB
15:30 - Building email template now
15:35 - Wondering if I should use SendGrid or Postmark
15:40 - Going with SendGrid (already have account)
15:45 - Configured API key, testing send...
[Break]
Resume thoughts:
- Was about to test email delivery
- SendGrid configured, key in .env
- Next: Trigger reset email from form
## Breadcrumb Trail (Auto-generated)
14:00 ✅ Created reset-password.tsx
14:15 ✅ Added form with email input
14:30 ✅ Connected to /api/reset-password
14:45 ✅ Generated reset token
15:00 ✅ Stored token in database
15:15 🔄 Building email template ← YOU ARE HERE
15:30 ⬜ Test email delivery
15:45 ⬜ Add reset confirmation page
You're making great progress! 🎉
[You haven't saved context in 45 min]
⏸️ Taking a break soon?
Quick save checklist:
- [ ] Commit current work (WIP okay!)
- [ ] Write next step (one sentence)
- [ ] Note any blockers
- [ ] Close unneeded tabs (reduce clutter)
Takes 2 minutes, saves 20 minutes later!
[Save Context Now] [Remind Me in 15m] [I'm not taking a break]
[17:00] End of day approaching!
🌙 Let's wrap up for easy tomorrow start:
1. Current Progress:
Built authentication flow
Progress: 75% complete
Status: Working well, needs testing
2. Tomorrow's First Task:
→ Test password reset flow (30 min)
→ File: src/auth/reset.ts
→ Should be quick!
3. Blockers for Tomorrow:
None! Ready to go.
4. Wins Today:
✅ Completed login form
✅ Added validation
✅ Connected to API
✅ Fixed bug #234
5. Mental Dump:
[Anything else to remember?]
> Remember to check email error handling
✅ Context saved! Tomorrow You will thank you. 🙏
[Finish Day] [Keep Working]
Every context save creates a WIP commit:
# Auto-runs every 15 min
git add .
git commit -m "WIP: $(cat .adhd/context.json | jq -r '.mental_state.doing') [15:30]"
# Example commits:
git commit -m "WIP: Adding API call to login endpoint [15:30]"
git commit -m "WIP: Testing password reset flow [15:45]"
git commit -m "PAUSE: About to add error handling [16:00]"
# See what you were doing
git log -1 --pretty=%B
# Output:
WIP: Testing password reset flow [15:45]
# Context notes:
- File: src/auth/reset.ts:67
- Next: Add error toast for failed reset
- Blocker: None
[14:45] Meeting in 15 minutes
Auto-save triggering:
- Current work committed
- Context snapshot created
- Resume script generated
After meeting: Run ./resume.sh
Estimated resume time: 5 minutes
You: "Urgent bug in production, need to switch"
Claude: No problem! Let me save your context first.
✅ Saved: Authentication flow work
✅ Stashed: Uncommitted changes
✅ Switched: To main branch
Work on the bug, I'll help you resume after.
Resume command: ./resume-auth-work.sh
[You've been browsing docs for 20 min]
💭 Gentle reminder:
You were working on: Password reset form
Current file: src/auth/reset.tsx:45
Next step: Add email input field (5 min)
Research is good, but maybe time to apply?
[Resume Coding] [Continue Research] [Take Break]
# Share context with teammate
./export-context.sh
Generated: context-snapshot.md
Send this to teammate for pairing:
- What you're working on
- Current progress
- What you need help with
- Exact file locations
# View past contexts
./context-history.sh
Recent Work Sessions:
1. 2025-10-22 14:00 - Auth flow (90 min) ✅ Completed
2. 2025-10-22 10:30 - Dashboard UI (2 hours) 🔄 In progress
3. 2025-10-21 15:00 - Bug fix #234 (45 min) ✅ Completed
[Load Context] [Delete] [Archive]
[Starting new session]
Claude: I notice you often work on:
- Authentication (70% of time)
- Dashboard UI (20%)
- Bug fixes (10%)
Would you like to:
A) Resume auth flow (where you left off)
B) Continue dashboard work (60% complete)
C) Check open bugs
D) Start something new
Based on your patterns, auth flow is most likely.
[Session Start]
Auto-save every: 15 minutes
Break reminders: Every 60 minutes
Context snapshots: On demand
[Session End]
Final save includes:
- Total focus time
- Tasks completed
- Progress made
- Tomorrow's start point
Project A → Project B
Auto-stash Project A:
- Commit WIP
- Save context
- Close related tabs
Load Project B:
- Restore last context
- Open relevant files
- Show next task
Switch time: < 5 minutes
Before pairing:
- Export current context
- Share with partner
- They see exactly what you're doing
After pairing:
- Update context with decisions made
- Log next steps
- Easy solo resume
cd your-project
mkdir .adhd
cp ~/ai-dev-standards/TEMPLATES/adhd/scripts/* ./
chmod +x .adhd/*.sh
# Scripts installed:
# - save-context.sh (manual save)
# - resume.sh (quick resume)
# - context-history.sh (view history)
# - export-context.sh (share with team)
# Morning: One command start
./resume.sh
# During work: Auto-saves every 15 min
# (runs in background)
# Before break: Quick save
./save-context.sh --break lunch
# After break: One command resume
./resume.sh
# End of day: Auto-prompted at 5pm
# (saves automatically)
Bad: Expecting yourself to manually write notes Why: ADHD brain won't do it consistently Good: Automated saves every 15 min
Bad: Writing detailed status reports Why: Wastes time, won't be maintained Good: Stream-of-consciousness quick notes
Bad: Overwriting same context file Why: Loses history, can't go back Good: Timestamped history, can browse past contexts
You're using this skill well when:
Save your place. Eliminate anxiety. Resume in 5 minutes. 💾
Weekly Installs
0
Repository
GitHub Stars
18
First Seen
Jan 1, 1970
Security Audits
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
144,300 周安装
TDD测试驱动开发工作流指南:从单元测试到E2E的完整实践
2,500 周安装
TanStack Query v5 完全指南:React 数据管理、乐观更新、离线支持
2,500 周安装
Convex 最佳实践指南:函数组织、查询优化与 TypeScript 生产级开发
2,500 周安装
探索性访谈技能:AI产品探索专家,将模糊想法转化为可实施规范
2,500 周安装
超级搜索插件 - 快速检索Claude编码会话与项目记忆,提升开发效率
2,600 周安装
ElevenLabs 文本转语音 API 使用指南 - 支持70+语言,提供高质量、低延迟语音合成
2,500 周安装