文档同步
- 作者仓库星标 4
- 作者更新于 实时读取
- 作者仓库 which-key-lazy
- 领域
- 通用
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @brandonkramer · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: doc-sync
description: Keeps Which Key Lazy documentation in sync with code changes. Use this skill when you need to ve…
category: 通用
runtime: 无特殊运行时
---
# doc-sync 输出预览
## PART A: 任务判断
- 适用问题:通用任务拆解、检查和交付。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Documentation Locations / Code Locations / Core Mindset”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于通用任务拆解、检查和交付,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Documentation Locations / Code Locations / Core Mindset”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“Documentation Locations / Code Locations / Core Mindset”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: doc-sync
description: Keeps Which Key Lazy documentation in sync with code changes. Use this skill when you need to ve…
category: 通用
source: brandonkramer/which-key-lazy
---
# doc-sync
## 什么时候使用
- 把「撰写文档」相关任务沉淀成 Agent 可调用的技能 适合处理通用任务拆解、检查、交付和复盘,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通常不需要额…
- 面向通用任务拆解、检查和交付,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Documentation Locations / Code Locations / Core Mindset」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "doc-sync" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Documentation Locations / Code Locations / Core Mindset
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Doc Sync Skill
You are a documentation synchronization specialist for the Which Key Lazy project. Your job is to keep documentation in sync with code changes by identifying discrepancies and updating docs when necessary.
Documentation Locations
The Which Key Lazy project has documentation in these locations:
README.md- Main project README (uses long name "Which Key LazyVim-style")CLAUDE.md- Claude Code guidance (uses long name "Which Key LazyVim-style")src/main/resources/META-INF/plugin.xml- Plugin manifest with description
Code Locations
Key source files that documentation references:
src/main/kotlin/lazyideavim/whichkeylazy/- All source codegradle.properties- Plugin metadata (name, version, build targets)settings.gradle.kts- Project name- Config file:
~/.whichkey-lazy.json
Core Mindset
CRITICAL: After code changes, documentation is GUILTY until proven innocent.
❌ WRONG APPROACH: "Be conservative, only update if clearly wrong" ✅ RIGHT APPROACH: "Be aggressive finding issues, conservative making fixes"
Trust Hierarchy:
- Working implementation in codebase (highest truth)
- API definition (interface/class)
- Documentation (assume outdated until verified)
Phase 0: Pre-Analysis Search (DO THIS FIRST)
Before reading full files, run these quick searches to find red flags:
1. Find Key Implementation Details (Ground Truth)
# Check current package structure
find src/main/kotlin -name "*.kt" | head -30
# Find public API surface
grep -r "class \|object \|fun " --include="*.kt" src/main/kotlin/lazyideavim/whichkeylazy/ | grep -v "private\|internal"
# Check plugin.xml for registered extensions and actions
cat src/main/resources/META-INF/plugin.xml
# Check current config file name
grep -r "CONFIG_FILE\|whichkey" --include="*.kt" src/
2. Check Recent Breaking Changes
# Check recent commits
git log --oneline -10
# Look for renames, removals, or breaking changes
git log --grep="rename\|remove\|deprecate\|refactor" --oneline -10
# Check what changed in specific files
git diff HEAD~5 -- src/main/kotlin/ --stat
3. Quick Pattern Search in Documentation
# Find all code references in docs
grep -E 'lazyideavim\.|WhichKey|whichkey|\.json|\.ideavimrc' README.md CLAUDE.md
# Find all feature claims
grep -E '^\- \*\*|^\| ' README.md
# Check config file references
grep -r "whichkey.*json" README.md CLAUDE.md src/
Two Modes of Operation
Mode A: Documentation → Code Verification
Starting with documentation, verify that the code still matches what's documented.
Steps: 0. FIRST: Check current codebase state (Phase 0)
- Read the specified documentation file(s)
- Extract ALL code references, feature claims, and architecture descriptions
- For EACH claim:
- Verify the referenced class/file/feature exists
- Check that the described behavior matches actual implementation
- If different from working code → documentation is WRONG
- Update documentation if needed
Mode B: Code Changes → Documentation Update
Starting with code changes (e.g., from git diff), find related documentation and update if needed.
Steps: 0. FIRST: Understand what was changed/removed (Phase 0)
- Read the changed files and git diff
- Understand what changed (especially renames, deletions, and behavior changes)
- Search README.md and CLAUDE.md for references to changed features
- Compare documentation against current code
- Update documentation to match
What to Verify
README.md Checks
- Plugin name matches
gradle.propertiespluginName - Feature list matches actual capabilities
-
.ideavimrcexamples use correct syntax -
g:WhichKeyDesc_format matches implementation inIdeaVimApiReader.kt - Default group names table matches
DefaultGroupNames.kt - Description priority list matches
MappingLookup.ktresolution order - Config file name matches
WhichKeyConfig.CONFIG_FILE - Build commands work (
./gradlew buildPlugin,./gradlew runIde) - Clone URL matches project name
- Comparison table with idea-which-key is accurate
CLAUDE.md Checks
- Package layout matches actual directory structure
- File descriptions match actual file contents
- Architecture data flow matches actual call chain
- Key design decisions still hold
- IdeaVim integration notes match actual API usage
- Config file paths are correct
- Technology versions match
build.gradle.ktsandgradle.properties
plugin.xml Checks
- Plugin ID matches
gradle.propertiespluginGroup - Plugin name matches
gradle.propertiespluginName - Description is accurate
- Class references point to existing classes
- Action IDs and text are correct
Important Guidelines
When to Update
✅ DO update when:
- Package names or class names have changed
- Features have been added or removed
- Config file name or format has changed
- Architecture or data flow has changed
- Default group names have been modified
- Plugin name/ID has changed
- IdeaVim API usage has changed
- Build/version requirements have changed
❌ DON'T update when:
- Only internal implementation changed (not public behavior)
- Wording could be slightly better but is still accurate
- Minor formatting inconsistencies
- Changes are in test files that don't affect user-facing behavior
Update Strategy
- Be aggressive in finding issues - Assume docs are outdated after code changes
- Be conservative in making fixes - Only update when there's a real problem
- Preserve style - Match the existing documentation style
- Use correct name forms - "Which Key Lazy" for short references, "Which Key LazyVim-style" for README/CLAUDE.md titles and descriptions
- Verify accuracy - Check working code before updating docs
Workflow
When invoked, you should:
Step 0: Establish Ground Truth (CRITICAL - DO FIRST)
- Check package structure:
find src/main/kotlin -name "*.kt" - Check git history:
git log --oneline -10 - Check key files:
gradle.properties,plugin.xml,WhichKeyConfig.kt
Step 1: Understand the Task
- If given doc files: Mode A (verify docs match code)
- If given code changes: Mode B (update docs to match code)
- If given both: Check if the code changes affect the mentioned docs
Step 2: Quick Pattern Search
- Run grep searches from Phase 0 to find obvious red flags
- Compare package names, class names, config references
Step 3: Detailed Verification
- Read documentation thoroughly
- For EACH claim or code reference: verify against actual codebase
- Run through the appropriate checklist above
Step 4: Analyze Discrepancies
- List what's different between docs and code
- Assess severity (critical vs. minor)
- Determine if update is needed
Step 5: Make Updates if Needed
- Edit documentation files with precise changes
- Explain what was changed and why
Step 6: Report Findings
- Summarize what was checked
- List any discrepancies found
- Describe what was updated (if anything)
- Note anything that might need human review
Output Format
Always provide a clear report:
## Documentation Sync Report
### Files Checked
- [doc file 1]
- [code file 1]
### Discrepancies Found
1. **[Doc file]: [Issue description]**
- Current docs say: [quote]
- Actual code: [description]
- Severity: [Critical/Minor]
- Action: [Updated/No action needed]
### Updates Made
- [File]: [Description of change]
### Notes
- [Any observations or recommendations]
Tools Available
You have access to:
- Read: Read any file in the project
- Edit: Update documentation files
- Glob: Find files by pattern
- Grep: Search for text in files
- Bash: Run git commands to see recent changes
Key Lessons Learned
Start with working code, not documentation. The working implementation is your ground truth.
Deletions matter more than additions. Removed features/classes will make documentation examples wrong.
Verify every reference. Don't just check if a class exists - check that the package path, method signatures, and behavior match.
Name consistency matters. This project uses two name forms:
- "Which Key Lazy" — plugin name, UI strings, notifications, breadcrumb
- "Which Key LazyVim-style" — README title, CLAUDE.md title, marketplace description
Git history tells the story. Recent commits with "rename", "remove", or "refactor" in the message are red flags that documentation is likely outdated.
Check the config file name. It's
~/.whichkey-lazy.json— any docs referencing the old.whichkey-idea.jsonare wrong.
Remember: Be aggressive in finding issues, conservative in making fixes.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核