[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75X98KRKX80JQ9Y4PR8WZCK":3,"skill-same:01M75X98KRKX80JQ9Y4PR8WZCK":63},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":44,"ownerHtmlUrl":45,"ownerBlogUrl":46,"ownerDescription":47,"updatedAt":48,"install":49,"resources":62},"01M75X98KRKX80JQ9Y4PR8WZCK","git-commit-hygiene",null,"在共享 worktree 多会话并行或暂存区有残留时提交代码——用显式 pathspec 只提交自己的文件并排除临时目录，禁止 git add -A 或裸 commit 扫入并行会话的改动","mambo-wang\u002FCodeWiki-Plus","mambo-wang","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F17296917?v=4","01M75489WXT2KCG0TDVRGMTEET","WanderingBug","01M75WY0F23J9DB5GBVTH8F8Q9",21,"MIT","https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002Frepowiki\u002Fskills\u002Fgit-commit-hygiene\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: git-commit-hygiene\ndescription: 在共享 worktree 多会话并行或暂存区有残留时提交代码——用显式 pathspec 只提交自己的文件并排除临时目录，禁止 git add -A 或裸 commit 扫入并行会话的改动\ntype: Skill\nstatus: draft\ngenerated:\n  by: codewiki\u002F5.15.0\n  at: \"2026-10-21T10:33:59Z\"\nstale_after: 2027-01-19\nmetadata:\n  summary: git 提交卫生：多会话共享 worktree 用显式 pathspec 隔离提交 + 单会话暂存区残留清理与临时目录排除\n  source_refs: [\"notes\u002F2026-10-21-共享工作区多会话并行时提交必须用显式-pathspec禁止-git-add--a-扫入并行会话的改动.md\", \"notes\u002F2026-09-20-提交前清理暂存区测试残留并排除-scratch-与-codebuddyteams-临时目录.md\"]\n  revisions:\n    - at: \"2026-10-21T10:33:59Z\"\n      reason: created from candidate materials\n      source: skill_creator\n---\n\n## 工作场景\n\n多个 agent 会话（或多人）共享同一 git worktree 并行干活，需要提交本会话的改动。典型信号：`git status` 里出现大量非本会话产生的改动（他人正在编辑的源码、笔记、任务记忆文件），其中一部分已被并行会话 `git add` 进暂存区。知识飞轮类工具（ingest_note\u002Fconfirm_note\u002Fadd_task_memory 等）会持续往 repowiki\u002F 写文件，多会话并行时工作区必然互相污染。\n\n## 适用条件\n\n- 工作区存在并行会话\u002F并行 agent 的进行中改动，需要提交本会话的修复。\n- 单会话场景下暂存区混入测试残留或临时目录产物，提交前需要清理。\n\n## 核心 SOP\n\n1. 提交前 `git status --short` + `git diff --cached --stat` 盘点：区分「本会话的文件」与「并行会话的文件」；暂存区里若有并行会话已暂存的内容，保持原样不动。\n2. 多会话场景用显式 pathspec 提交，绕过被污染的 index：\n\n   ```\n   git commit -m \"...\" -- \u003C自己的文件1> \u003C自己的文件2>\n   ```\n\n   `git commit -- \u003Cpaths>` 只提交指定路径的工作区内容，不动 index 里他人已暂存的文件（实测提交后并行会话的暂存内容原样保留）。\n3. 提交前 `git diff -- \u003Cpaths>` 核对 diff 确实只含自己的修复，量级与预期一致。\n4. 提交后 `git status --short -- \u003C自己的文件>` + `git log --oneline -1` 核验：自己的文件已 clean、提交内容正确。\n5. 单会话残留场景：先 `git restore --staged \u003C残留路径>` 取消暂存，再用排除模式 `git add -A -- . ':!.scratch' ':!\u003C临时目录>'` 后提交，`git status --short` 复核暂存内容。\n\n## 判断逻辑\n\n- 多会话并行 → 显式 pathspec 提交（index 不可信，绕过它而不是清理它）。\n- 单会话但有测试\u002F临时产物残留 → 清理暂存 + 排除模式（index 可信，清理它）。\n- 不确定某文件归属 → 先查（读文件内容\u002F问用户），不猜着提交。\n\n## 禁忌与反模式\n\n- 严禁多会话场景下 `git add -A` 或裸 `git commit`——会把并行会话的半成品改动固化进历史，且难以回退。\n- 不要 `git restore --staged` 并行会话已暂存的文件——那是别人的进行中工作。\n- 不要依赖下游幂等当安全网。\n\n依据: notes\u002F2026-10-21-共享工作区多会话并行时提交必须用显式-pathspec禁止-git-add--a-扫入并行会话的改动.md（pathspec 提交实测后并行会话暂存内容原样保留，互不干扰）；notes\u002F2026-09-20-提交前清理暂存区测试残留并排除-scratch-与-codebuddyteams-临时目录.md（单会话残留清理与 .scratch\u002Fteams 临时目录排除模式）。\n","## 工作场景\n\n多个 agent 会话（或多人）共享同一 git worktree 并行干活，需要提交本会话的改动。典型信号：`git status` 里出现大量非本会话产生的改动（他人正在编辑的源码、笔记、任务记忆文件），其中一部分已被并行会话 `git add` 进暂存区。知识飞轮类工具（ingest_note\u002Fconfirm_note\u002Fadd_task_memory 等）会持续往 repowiki\u002F 写文件，多会话并行时工作区必然互相污染。\n\n## 适用条件\n\n- 工作区存在并行会话\u002F并行 agent 的进行中改动，需要提交本会话的修复。\n- 单会话场景下暂存区混入测试残留或临时目录产物，提交前需要清理。\n\n## 核心 SOP\n\n1. 提交前 `git status --short` + `git diff --cached --stat` 盘点：区分「本会话的文件」与「并行会话的文件」；暂存区里若有并行会话已暂存的内容，保持原样不动。\n2. 多会话场景用显式 pathspec 提交，绕过被污染的 index：\n\n   ```\n   git commit -m \"...\" -- \u003C自己的文件1> \u003C自己的文件2>\n   ```\n\n   `git commit -- \u003Cpaths>` 只提交指定路径的工作区内容，不动 index 里他人已暂存的文件（实测提交后并行会话的暂存内容原样保留）。\n3. 提交前 `git diff -- \u003Cpaths>` 核对 diff 确实只含自己的修复，量级与预期一致。\n4. 提交后 `git status --short -- \u003C自己的文件>` + `git log --oneline -1` 核验：自己的文件已 clean、提交内容正确。\n5. 单会话残留场景：先 `git restore --staged \u003C残留路径>` 取消暂存，再用排除模式 `git add -A -- . ':!.scratch' ':!\u003C临时目录>'` 后提交，`git status --short` 复核暂存内容。\n\n## 判断逻辑\n\n- 多会话并行 → 显式 pathspec 提交（index 不可信，绕过它而不是清理它）。\n- 单会话但有测试\u002F临时产物残留 → 清理暂存 + 排除模式（index 可信，清理它）。\n- 不确定某文件归属 → 先查（读文件内容\u002F问用户），不猜着提交。\n\n## 禁忌与反模式\n\n- 严禁多会话场景下 `git add -A` 或裸 `git commit`——会把并行会话的半成品改动固化进历史，且难以回退。\n- 不要 `git restore --staged` 并行会话已暂存的文件——那是别人的进行中工作。\n- 不要依赖下游幂等当安全网。\n\n依据: notes\u002F2026-10-21-共享工作区多会话并行时提交必须用显式-pathspec禁止-git-add--a-扫入并行会话的改动.md（pathspec 提交实测后并行会话暂存内容原样保留，互不干扰）；notes\u002F2026-09-20-提交前清理暂存区测试残留并排除-scratch-与-codebuddyteams-临时目录.md（单会话残留清理与 .scratch\u002Fteams 临时目录排除模式）。\n",{"name":5,"type":24,"status":25,"metadata":26,"generated":36,"description":7,"stale_after":38},"Skill","draft",{"summary":27,"revisions":28,"source_refs":33},"git 提交卫生：多会话共享 worktree 用显式 pathspec 隔离提交 + 单会话暂存区残留清理与临时目录排除",[29],{"at":30,"reason":31,"source":32},"2026-10-21T10:33:59Z","created from candidate materials","skill_creator",[34,35],"notes\u002F2026-10-21-共享工作区多会话并行时提交必须用显式-pathspec禁止-git-add--a-扫入并行会话的改动.md","notes\u002F2026-09-20-提交前清理暂存区测试残留并排除-scratch-与-codebuddyteams-临时目录.md",{"at":30,"by":37},"codewiki\u002F5.15.0",1800316800000,"develop","ba8919e7a5182cc94dbe3e9b3a46f4c2e8fa209d","repowiki\u002Fskills\u002Fgit-commit-hygiene",4,"https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus","https:\u002F\u002Fpypi.org\u002Fproject\u002Fcodewiki-plus\u002F","https:\u002F\u002Fgithub.com\u002Fmambo-wang","https:\u002F\u002Fblog.csdn.net\u002Fsinat_27143551","专注Java后端开发，喜欢运动","2026-11-13 15:29:46",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add mambo-wang\u002FCodeWiki-Plus --skill git-commit-hygiene",{"tool":55,"command":56},"bunx","bunx skills add mambo-wang\u002FCodeWiki-Plus --skill git-commit-hygiene",{"tool":58,"command":59},"pnpm","pnpm dlx skills add mambo-wang\u002FCodeWiki-Plus --skill git-commit-hygiene","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002Frepowiki\u002Fskills\u002Fgit-commit-hygiene\u002FSKILL.md",true,[],[64,71,78,85,92,99],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M75XA78546E66PCC3JV2TM3Q","write-doc-file-content-file-sidechannel","write_doc_file 建档报目标路径已被手写文件占用\u002F路由冲突时——走 content_file 临时文件侧通道：正文写临时文件→删占位文件→write_doc_file(content_file=...) 正式建档→删临时文件","https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002Frepowiki\u002Fskills\u002Fwrite-doc-file-content-file-sidechannel\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M75X9YQNDX8B6ZEVMKGM2TYR","windows-python-release","当要手动发布 Python 包（codewiki-plus）到 PyPI 并建 GitHub Release 时——CI 不发布、Windows 控制台为 GBK、可能无 gh CLI、本机网络对 upload.pypi.org 的 Python TLS 握手有干扰——先核对 tag 区间与工作区未提交改动定 bump 级别，再按 8 步主干执行：同步四处版本→bump 提交（只 add 具体文件）→聚焦+ruff+全量闸门→清 dist 构建→PR 合并 main→tag merge commit 建 Release→uv publish（TLS 超时则 curl.exe 直传）→PyPI JSON API 核对","https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002Frepowiki\u002Fskills\u002Fwindows-python-release\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M75X9MGBPRG6JDCRAY97E5T0","windows-dev-env","Windows\u002FPowerShell 下做 git 写操作、跑子进程或批量文件\u002F测试清理时：shell 漂移与中文路径致命令静默失败、无控制台宿主子进程闪窗、GCM 每次弹 OAuth 框、原生 DLL 被锁——须显式复核落盘、subprocess 加 CREATE_NO_WINDOW、gh auth setup-git 持久化凭据，并用 cmd \u002Fc 绕 safe-delete 钩子","https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002Frepowiki\u002Fskills\u002Fwindows-dev-env\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M75X9H4YYF5C29JR7AF44K84","repowiki-conclusion-update","已落库 repowiki 结论发生变化时，按「结论方向 vs 表述」分流：方向变则新写 decision 笔记+reject_note 旧+confirm 并回源 ADR，仅表述\u002F证据变则 edit_doc_file 原地改","https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002Frepowiki\u002Fskills\u002Frepowiki-conclusion-update\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M75X9CD6FDMX1RDE9NZEFNVY","maintain-fork-pr-merge","当合入 fork 来源的 PR 且 mergeStateStatus=CONFLICTING\u002FDIRTY 时——先 git merge-tree 探测冲突清单，查 maintainer_can_modify，再在 worktree 隔离目录解冲突后 push fork 分支，勿因 CI 绿直接 merge","https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002Frepowiki\u002Fskills\u002Fmaintain-fork-pr-merge\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M75X974418SW9AX2J45B43Q0","writing-shape","Writing, exploit: shape raw material into an article, paragraph by paragraph.","https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002F.trae\u002Fskills\u002Fwriting-shape\u002FSKILL.md",[],[]]