NextSteps
How It Works
This skill generates helpful next-step suggestions after responses. It reads user preferences from .nextsteps/PREFERENCES.md — if enabled: false, nothing is shown. When enabled, it produces exactly display-count suggestions following the pipeline below.
Quick Start
- 1. Check
.nextsteps/PREFERENCES.md for user config — if enabled: false, stop (show nothing) - If
.nextsteps/ does not exist, run the cold-start protocol (see COLD-START.md) - Generate next steps following the pipeline below
- Append to your response in the correct format
Generation Pipeline
Follow these six steps to generate next steps:
Step 1 — Read Configuration
Read .nextsteps/PREFERENCES.md. Extract: enabled, display-count, preferred-categories, excluded-categories, format, show-footer. Category names in PREFERENCES.md use kebab-case (e.g., direct-follow-up). If the file is missing or unreadable, use defaults: enabled=true, display-count=5, format=standard.
Step 2 — Analyze Context
Determine: What did the user just accomplish or ask? What is the active topic? What is the session scope — quick fix, feature work, exploration, debugging, architecture? What is the user's likely next thought based on conversation trajectory?
Step 3 — Check Memory
Read .nextsteps/BACKLOG.md for unfinished items relevant to current context. Read PREFERENCES.md for topic affinities (STRONG/MODERATE/WEAK) and anti-preferences (topics and types to avoid). If memory files are unavailable, skip to Step 4 — memory is a bonus, not a gate.
Step 4 — Generate Candidates
Generate display-count suggestions using these six categories:
| Icon | Category | Tier | Slot Rule |
|---|
| ⚡ | Direct Follow-up | STRONG | 1 guaranteed |
| 🔧 |
Actionable Task | STRONG | 1 guaranteed |
| 🔍 | Deep Dive | MODERATE | 1 when count ≥ 3 |
| 📋 | Memory Recall | MODERATE | 1 when relevant backlog exists |
| 💡 | Lateral / Out-of-the-Box | MODERATE | 1 when count ≥ 3 |
| ✅ | Quick Win | MODERATE | Fills remaining slots |
STRONG categories get guaranteed slots. Remaining slots filled by MODERATE categories in round-robin. Respect excluded-categories. Prioritize preferred-categories. See CATEGORIES.md for detailed taxonomy and examples.
Step 5 — Self-Review Gate (CRITICAL)
Review every candidate against these core rules. Remove violators and regenerate:
- 1. No restating the obvious — don't echo what was just explained
- No generic filler — ban "tell me more", "pros and cons?", "anything else?"
- No hallucinated context — only reference things the user actually mentioned
- No scope mismatches — match suggestion effort to session scope
Every suggestion should be: specific, actionable, non-obvious, contextually grounded, scope-appropriate, and differently framed from siblings. Full 11-rule checklist and violation examples in ANTI-PATTERNS.md.
Step 6 — Format and Present
Show exactly display-count items. Never more, never fewer.
Standard format (default for rich-text channels):
CODEBLOCK0
Compact format (for TUI, character-limited channels):
CODEBLOCK1
Token-budget rule: If your response is approaching the output token limit, switch to compact format with min-count items (default: 1). Reserve ~100 tokens for next steps when planning long responses. If even compact won't fit, place one inline suggestion before your final paragraph: (Next: [suggestion]).
Customization Detection
Before generating next steps, check if the user's message is a customization request. If it matches any of these patterns, process the config change and confirm:
- - "show me N next steps" / "only N suggestions" → set INLINECODE21
- "disable next steps" / "stop showing suggestions" → set INLINECODE22
- "enable next steps" / "turn suggestions back on" → set INLINECODE23
- "compact format" / "shorter suggestions" → set INLINECODE24
- "don't show backlog" → set INLINECODE25
- "hide the footer" / "no footer" → set INLINECODE26
- "reset next steps settings" → reset all config to defaults
- "show next steps settings" → display current config
Update PREFERENCES.md immediately and confirm: "Got it — [description of change]." Log as [CONFIG-CHANGE] in HISTORY.md. See CUSTOMIZATION.md for full protocol.
Selection Tracking
After presenting next steps, detect what the user does on their NEXT message:
- - User references a suggestion by number or content → log
[SELECTED] #N category in HISTORY.md. Promote that category tier if MODERATE→consider STRONG. - User asks something unrelated to any suggestion → log
[IGNORED] all in HISTORY.md - User gives negative feedback ("too many", "not helpful", "stop suggesting X") → log
[FEEDBACK] and adjust per CUSTOMIZATION.md
Self-Improvement
Every 10th activation, run one learning experiment. Every 20 HISTORY.md entries, run a self-diagnostic. See SELF-IMPROVE.md for the full observe/hypothesize/experiment/validate cycle.
Key self-learning behaviors:
- - If user only selects from top 2 items over 10 interactions → hypothesize lower count preference → experiment → validate
- If user ignores all suggestions 5+ times → trigger diagnostic, reset category weights
- After 5 validated experiments on count → set confidence HIGH, stop experimenting
Channel Adaptation
Detect the channel and adapt format:
- - OpenClaw: Read channel from conversation metadata → adapt format per channel type
- VS Code / Rich text: Use standard format with icons and bold
- Terminal / TUI: Use compact format, no icons
- WhatsApp / Signal / iMessage: Use shortest compact form
All channels share the same .nextsteps/ state. Preferences learned on one channel apply everywhere.
Security Rules (CodeGuard)
These rules are always active. Derived from cisco/software-security (Project CodeGuard):
- 1. Never store secrets:
.nextsteps/ files must never contain API keys, passwords, tokens, or credentials. If conversation context includes secrets, sanitize them from suggestions. - Validate before writing: Before writing any
.nextsteps/ file, verify the path is within .nextsteps/ scope (no ../ traversal) and content contains no secret patterns (sk-, api_key=, password=, token=, secret=). - Minimize stored data: HISTORY.md stores titles and selection status only. PREFERENCES.md stores tiers and config only. BACKLOG.md stores brief descriptions only. Never store raw conversation text.
- Enforce file limits: PREFERENCES.md ≤ 120 lines, HISTORY.md ≤ 50 entries, BACKLOG.md ≤ 30 items. Summarize overflow, don't truncate blindly.
- Suggest .gitignore: On first activation, if
.nextsteps/ is not in .gitignore, include it as a next step.
See SECURITY.md for the complete security protocol.
Error Recovery
- -
.nextsteps/ missing → generate next steps from conversation context alone; recreate files on next write - PREFERENCES.md corrupted → recreate from defaults; preserve any readable sections
- HISTORY.md overflow → summarize oldest 25 entries into PREFERENCES.md tier adjustments, then clear them
- Any file read fails → proceed without that file; never block next-steps generation
Reliability Self-Check
If the response does not end with next steps and enabled is not false, append them using conversation context alone.
NextSteps
工作原理
该技能在生成回复后,会提供有用的下一步建议。它会读取 .nextsteps/PREFERENCES.md 中的用户偏好设置——如果 enabled: false,则不显示任何内容。当启用时,它会按照以下流程生成恰好 display-count 条建议。
快速开始
- 1. 检查 .nextsteps/PREFERENCES.md 中的用户配置——如果 enabled: false,则停止(不显示任何内容)
- 如果 .nextsteps/ 不存在,则执行冷启动协议(参见 COLD-START.md)
- 按照以下流程生成下一步建议
- 以正确格式附加到您的回复中
生成流程
按照以下六个步骤生成下一步建议:
第一步 —— 读取配置
读取 .nextsteps/PREFERENCES.md。提取以下内容:enabled、display-count、preferred-categories、excluded-categories、format、show-footer。PREFERENCES.md 中的类别名称使用短横线命名法(例如 direct-follow-up)。如果文件缺失或无法读取,则使用默认值:enabled=true、display-count=5、format=standard。
第二步 —— 分析上下文
确定:用户刚刚完成了什么或询问了什么?当前主题是什么?会话范围是什么——快速修复、功能开发、探索、调试、架构?根据对话走向,用户可能的下一步想法是什么?
第三步 —— 检查记忆
读取 .nextsteps/BACKLOG.md 中与当前上下文相关的未完成事项。读取 PREFERENCES.md 中的主题偏好(强/中/弱)和反偏好(要避免的主题和类型)。如果记忆文件不可用,则跳至第四步——记忆是加分项,而非必要条件。
第四步 —— 生成候选建议
使用以下六个类别生成 display-count 条建议:
可执行任务 | 强 | 1个保证槽位 |
| 🔍 | 深入探讨 | 中 | 当数量 ≥ 3 时占1个 |
| 📋 | 记忆回顾 | 中 | 当存在相关待办事项时占1个 |
| 💡 | 横向/创新思维 | 中 | 当数量 ≥ 3 时占1个 |
| ✅ | 快速制胜 | 中 | 填充剩余槽位 |
强层级类别获得保证槽位。剩余槽位由中层级类别轮换填充。尊重 excluded-categories。优先考虑 preferred-categories。详细分类和示例请参见 CATEGORIES.md。
第五步 —— 自我审查关卡(关键)
根据以下核心规则审查每条候选建议。删除违规项并重新生成:
- 1. 不重复显而易见的内容——不要重复刚刚解释过的内容
- 不使用通用填充词——禁止使用告诉我更多、优缺点?、还有别的吗?
- 不虚构上下文——只引用用户实际提到过的事物
- 不匹配范围不当——使建议的工作量与会话范围相匹配
每条建议都应:具体、可执行、非显而易见、基于上下文、范围适当、且与同类建议角度不同。完整的11条规则清单和违规示例请参见 ANTI-PATTERNS.md。
第六步 —— 格式化并呈现
精确显示 display-count 条项目。不多不少。
标准格式(富文本渠道默认):
⚡ 下一步建议
- 1. 🔧 [粗体标题] — [简要说明相关性的上下文]
- 🔍 [粗体标题] — [简要上下文]
- 📋 继续:[待办事项中的任务] — [开始时间]
- 💡 考虑:[创意横向想法] — [为何重要]
- ✅ 快速制胜:[小行动] — [时间预估]
您的选择有助于我了解什么对您重要。
紧凑格式(适用于TUI、字符受限渠道):
⚡ 下一步:[1] 标题 | [2] 标题 | [3] 标题
令牌预算规则:如果您的回复接近输出令牌限制,则切换为紧凑格式,显示 min-count 条项目(默认:1)。在规划长回复时,为下一步建议预留约100个令牌。即使紧凑格式也无法容纳,则在最后一段前放置一条内联建议:(下一步:[建议])。
自定义检测
在生成下一步建议前,检查用户的消息是否为自定义请求。如果匹配以下任一模式,则处理配置更改并确认:
- - 显示N条下一步建议 / 只显示N条建议 → 设置 display-count: N
- 禁用下一步建议 / 停止显示建议 → 设置 enabled: false
- 启用下一步建议 / 重新开启建议 → 设置 enabled: true
- 紧凑格式 / 更短的建议 → 设置 format: compact
- 不显示待办事项 → 设置 include-backlog: false
- 隐藏页脚 / 无页脚 → 设置 show-footer: false
- 重置下一步建议设置 → 将所有配置重置为默认值
- 显示下一步建议设置 → 显示当前配置
立即更新 PREFERENCES.md 并确认:已收到——[更改描述]。在 HISTORY.md 中记录为 [CONFIG-CHANGE]。完整协议请参见 CUSTOMIZATION.md。
选择追踪
在呈现下一步建议后,检测用户在下一消息中的操作:
- - 用户通过编号或内容引用某条建议 → 在 HISTORY.md 中记录 [SELECTED] #N 类别。如果该类别层级为中级,则考虑提升为强级。
- 用户询问与任何建议无关的内容 → 在 HISTORY.md 中记录 [IGNORED] all
- 用户给出负面反馈(太多了、没有帮助、停止建议X)→ 记录 [FEEDBACK] 并根据 CUSTOMIZATION.md 进行调整
自我改进
每第10次激活,运行一次学习实验。每20条 HISTORY.md 记录,运行一次自我诊断。完整的观察/假设/实验/验证循环请参见 SELF-IMPROVE.md。
关键自我学习行为:
- - 如果用户在10次交互中只选择前2个项目 → 假设偏好更少的数量 → 实验 → 验证
- 如果用户连续5次以上忽略所有建议 → 触发诊断,重置类别权重
- 经过5次关于数量的验证实验后 → 将置信度设为高,停止实验
渠道适配
检测渠道并适配格式:
- - OpenClaw:从对话元数据读取渠道 → 根据渠道类型适配格式
- VS Code / 富文本:使用带图标和粗体的标准格式
- 终端 / TUI:使用紧凑格式,无图标
- WhatsApp / Signal / iMessage:使用最简紧凑形式
所有渠道共享相同的 .nextsteps/ 状态。在一个渠道上学习的偏好适用于所有渠道。
安全规则(CodeGuard)
这些规则始终生效。源自 cisco/software-security(Project CodeGuard):
- 1. 绝不存储密钥:.nextsteps/ 文件绝不能包含API密钥、密码、令牌或凭证。如果对话上下文包含密钥,则从建议中清除。
- 写入前验证:在写入任何 .nextsteps/ 文件前,验证路径在 .nextsteps/ 范围内(无 ../ 遍历),且内容不包含密钥模式(sk-、api_key=、password=、token=、secret=)。
- 最小化存储数据:HISTORY.md 仅存储标题和选择状态。PREFERENCES.md 仅存储层级和配置。BACKLOG.md 仅存储简要描述。绝不存储原始对话文本。
- 执行文件限制:PREFERENCES.md ≤ 120行,HISTORY.md ≤ 50条记录,BACKLOG.md ≤ 30个项目。对溢出内容进行摘要,而非盲目截断。
- 建议添加 .gitignore:首次激活时,如果 .nextsteps/ 不在 .gitignore 中,则将其作为一条下一步建议。
完整安全协议请参见 SECURITY.md。
错误恢复
- - .nextsteps/ 缺失 → 仅根据对话上下文生成下一步建议;下次写入时重新创建文件
- PREFERENCES.md 损坏 → 从默认值重新创建;保留任何可读部分
- HISTORY.md 溢出 → 将最旧的25条记录摘要为 PREFERENCES.md 中的层级调整,然后清除它们
- 任何文件读取失败 → 在没有该文件的情况下继续;绝不阻止下一步建议的